by reference call to unsafe void** argument

  • Thread starter Francois Vanderseypen
  • Start date
F

Francois Vanderseypen

Context: C# wrapper around Tivoli LDAP C library.

I understand that something like

"public static unsafe void init(void** LDAPObj)"

has to do with a byref call.

Question: How do I have to wrap or call this function?

Note: the init function is a DllImport with the same parameter(s).


Thank you for any help, F.
 
N

Nicholas Paldino [.NET/C# MVP]

Francois,

What is LDAPObj?

If I wanted to get around the unsafe call, I would do the following:

public static extern void init(IntPtr LDAPObj)

And then work from there. However, depending on what LDAPObj is, you
might be able to make a more type-safe definition.

Also, if this returns pointers to regular C++ objects, then you won't be
able to use those objects, unless you are doing something else (like
wrapping them in managed code, exposing them through COM, etc, etc).

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top