nastoski
Technical User
- Oct 21, 2003
- 21
Dear all,
While importing C++ dll in my C# application I’m experiencing following problem with last parameter sessionID
I’m experiencing a problem while doing
[DllImport("ClientLib.dll", EntryPoint="APIconnect", CallingConvention=CallingConvention.ThisCall)]
public static extern int APIconnect ([MarshalAs(UnmanagedType.LPStr)] string username, [MarshalAs(UnmanagedType.LPStr)] string password,[MarshalAs(UnmanagedType.LPStr)] string address,int port,[MarshalAs(UnmanagedType.LPStr)] string appid, [MarshalAs(UnmanagedType.U4)] uint sessionId);
with last parameter uint sessionID and error is shown:can not reference the object.
int connectRespond = APIconnect("test", "test", "testhost", 1112, "app4", 4);
The function in dll is declared as:
int APIconnect (const char *username,
const char *password,
const char *address,
int port,
const char *appid,
unsigned int *sessionID);
Can anybody help me and tell me how to Marshal unsigned int *sessionID?
Regards
Igor Nastoski
While importing C++ dll in my C# application I’m experiencing following problem with last parameter sessionID
I’m experiencing a problem while doing
[DllImport("ClientLib.dll", EntryPoint="APIconnect", CallingConvention=CallingConvention.ThisCall)]
public static extern int APIconnect ([MarshalAs(UnmanagedType.LPStr)] string username, [MarshalAs(UnmanagedType.LPStr)] string password,[MarshalAs(UnmanagedType.LPStr)] string address,int port,[MarshalAs(UnmanagedType.LPStr)] string appid, [MarshalAs(UnmanagedType.U4)] uint sessionId);
with last parameter uint sessionID and error is shown:can not reference the object.
int connectRespond = APIconnect("test", "test", "testhost", 1112, "app4", 4);
The function in dll is declared as:
int APIconnect (const char *username,
const char *password,
const char *address,
int port,
const char *appid,
unsigned int *sessionID);
Can anybody help me and tell me how to Marshal unsigned int *sessionID?
Regards
Igor Nastoski