F
Francois Vanderseypen
I have a C-library to access a Tivoli LDAP directory. Thanks to this
newsgroup I managed to find the correct DllImport (thanks everybody!),
which is:
[DllImport("SIT_UML.dll", EntryPoint="SIT_Registry_Initialise")]public
static extern int InitializeRegistry(ref UIntPtr
LDAPSession,[MarshalAs(UnmanagedType.LPStr)]string
HostPort,[MarshalAs(UnmanagedType.LPStr)]string
AdminUserID,[MarshalAs(UnmanagedType.LPStr)]string AdminPassword);
The LDAPSession is created in my call and I can see that the variable
has a value. In the LDAP browser I can also see a connection is
created, however when I try to pass this to a call as a ref argument
I get an error stating "Object reference not set to an instance of an
object."
The signature in the C-lib is:
[DllImport("SIT_UML.dll", EntryPoint="SIT_TAM_User_Create")]public
static extern int CreateUser(ref UIntPtr LDAPSession,string
TAMID,string UserID,string UserPassword,int Complete);
which I call via
CreateUser(ref LDAPSession,"user","userDN","123",1);
It seems as if the memory block is created but does not contain the
right information? Do I have to cast?
Thanks for helping me out!
newsgroup I managed to find the correct DllImport (thanks everybody!),
which is:
[DllImport("SIT_UML.dll", EntryPoint="SIT_Registry_Initialise")]public
static extern int InitializeRegistry(ref UIntPtr
LDAPSession,[MarshalAs(UnmanagedType.LPStr)]string
HostPort,[MarshalAs(UnmanagedType.LPStr)]string
AdminUserID,[MarshalAs(UnmanagedType.LPStr)]string AdminPassword);
The LDAPSession is created in my call and I can see that the variable
has a value. In the LDAP browser I can also see a connection is
created, however when I try to pass this to a call as a ref argument
I get an error stating "Object reference not set to an instance of an
object."
The signature in the C-lib is:
[DllImport("SIT_UML.dll", EntryPoint="SIT_TAM_User_Create")]public
static extern int CreateUser(ref UIntPtr LDAPSession,string
TAMID,string UserID,string UserPassword,int Complete);
which I call via
CreateUser(ref LDAPSession,"user","userDN","123",1);
It seems as if the memory block is created but does not contain the
right information? Do I have to cast?
Thanks for helping me out!