by reference call to unsafe void** argument

  • Thread starter Thread starter Francois Vanderseypen
  • Start date 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.
 
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.
 
Back
Top