What is the definition of SOCKET in your C code? On Tue, Jul 12, 2016 at 1:43 PM Karli Kund <karli...@gmail.com> wrote:
> Thanks a lot. It can call the function now and fills the sockfd(fd) with > output. But its wrong output. It should be 128, but in Julia set it 552. I > try different variables (8,16,32,64). nothing helps. Don't know if its > Julia problem or what. > > > tiistai 12. heinäkuuta 2016 0.31.46 UTC+3 Bart Janssens kirjoitti: > >> That looks very much like a plain C API, so I guess you'll get by with >> ccall. What to pass as socket depends on the type, but presumably you can >> pass a pointer to some integer type. Supposing SOCKET is a 32bit integer, >> something like this might work: >> fd = Array{Int32}(1) >> ccall((:MServerInit, your_lib), ..., (Ptr{Int32), ...), fd, ...) >> >> I'm assuming here that MServerInit initializes the value of fd, if you >> need to pass it a valid value you probably need to call another C function >> to obtain it first. >> >> >> Op ma 11 jul. 2016 11:28 schreef Karli Kund <karl...@gmail.com>: >> > >>> Found a solution or problem. My .dll file was 32-bit and Julia was 64. >>> So luckily I have 64-bit version of the library also, so now it founds >>> it. Now I have problem with variables that go in and returns. Function that >>> I'm calling is "int MServerInit(SOCKET *sockfd, int port)". It should >>> return int. Problem is with that "SOCKET *sockfd" variable. how to I send >>> that? In visual studio, if I pause it, it shows 128 number. So it's bit >>> rate? >>> >>> >>>>> >>>>>