Hello community,

I am fresh at Julia language and I am fascinated about the possibilities.
At the moment I examine the possibilities to communicate with C libraries. 
And here I have a question.

I have a structure of pointers as parameter for a C function
struct connparam{
  charU * name
  charU * value
}

In Julia I try this:
type connparam
  name::Ptr{UInt16}
  value::Ptr{UInt16}
end

uname = "UserName"
uvalue = "Stefan"
cp = connparams(utf16(uname), utf16(uvalue))

ccall((:Test, "CTest.dll"), stdcall, Void, (Ptr{Void},), cp)

But this is not the correct way to transfer type data to a C function, 
because I get the error:
MethodError: `convert` has no method matching convert(::Type{Ptr{UInt16}}, 
::UTF16String)

What is the correct way to fill the structure with pointers and to transfer 
it to the C function?

Thanks for tips and hints.

Cheers
Stefan

Reply via email to