From: Gin Mendi Date: 2009-07-15T15:04:32+09:00 Subject: Re: Using DLLs with my Ruby app Thanks Ellie, I'm making a bit of progress here, this is what I did. require 'dl' dll = DL.dlopen("myAPI.dll") server_logon = dll["_serverLogon@20", "0SSS00"] result = server_logon.call("user", "pass", "address", nil, nil) now I get "DL::DLTypeError: unknown type '0' of the return value." I really don't have any experience with C or DLLs but I went through the function specs and I tried using another logon function: Handle serverLogonEx(LPCSTR username, LPCSTR password, LPCSTR servername, EVENT_NOTIFY notify, LPVOID userdata) Handle is a type definition of LPVOID, while EVENT_NOTIFY is a function callback. These are all a little new to me since I have no experience with C but just reading online and putting things together. This is now what I tried: require 'dl' dll = DL.dlopen("myAPI.dll") server_logon = dll["_serverLogonEx@20", "PcccPP"] # still putting @20 result = server_logon.call("user", "pass", "some_address", nil, nil) and I get the following results: OpenPipe error 1113 - \\unknown type '0' of the return value.\pipe\dbserver but I get a return from irb: [nil, [117, 112, 49, nil, nil]] I'm guessing the first element in that array is the returned value and the 2nd element which is an array was my original paramters passed? Perhaps I'm defining my function incorrectly? -- Posted via http://www.ruby-forum.com/.