P
peetersb
Hello,
I'v a dll written in C/C++. I only have the header file.
I dont know how to declare the external funtion:
I've got a EntryPointNotFoundException, I think because of the wrong
return type.
The function in the header file return a enum. But I don't know how to
declare it in my c# file.
Can anybody help me?
[DllImport("IHUAPI.dll")]
public static extern int ihuConnect(String server,String
username,String password,ref long serverhandle);
This is the header file:
#define IHUAPI __stdcall
/*
** All possible errors returned by the API functions.
** These do not need to match system API
*/
typedef enum {
ihuSTATUS_OK = 0,
ihuSTATUS_FAILED = 100,
ihuSTATUS_API_TIMEOUT = 101,
ihuSTATUS_NOT_CONNECTED = 102,
ihuSTATUS_INTERFACE_NOT_FOUND = 103,
ihuSTATUS_NOT_SUPPORTED = 104,
ihuSTATUS_DUPLICATE_DATA = 105,
ihuSTATUS_NOT_VALID_USER = 106,
ihuSTATUS_ACCESS_DENIED = 107,
ihuSTATUS_WRITE_IN_FUTURE = 108,
ihuSTATUS_WRITE_ARCH_OFFLINE = 109,
ihuSTATUS_ARCH_READONLY = 110,
ihuSTATUS_WRITE_OUTSIDE_ACTIVE = 111,
ihuSTATUS_WRITE_NO_ARCH_AVAIL = 112,
ihuSTATUS_INVALID_TAGNAME = 113,
ihuSTATUS_LIC_TOO_MANY_TAGS = 114,
ihuSTATUS_LIC_TOO_MANY_USERS = 115,
ihuSTATUS_LIC_INVALID_LIC_DLL = 116,
ihuSTATUS_NO_VALUE = 117,
ihuSTATUS_NOT_LICENSED = 118,
ihuSTATUS_CALC_CIRC_REFERENCE = 119,
ihuSTATUS_DUPLICATE_INTERFACE = 120,
ihuSTATUS_BACKUP_EXCEEDED_SPACE = 121,
ihuSTATUS_INVALID_SERVER_VERSION = 122,
ihuSTATUS_DATA_RETRIEVAL_COUNT_EXCEEDED = 123,
ihuSTATUS_INVALID_PARAMETER = 124,
ihuSTATUS_MAX_ERROR_NUM = 124
} ihuErrorCode;
/* for connecting to one server */
ihuErrorCode IHUAPI ihuConnect
(
char * server,
char * username,
char * password,
long * serverhandle
);
I'v a dll written in C/C++. I only have the header file.
I dont know how to declare the external funtion:
I've got a EntryPointNotFoundException, I think because of the wrong
return type.
The function in the header file return a enum. But I don't know how to
declare it in my c# file.
Can anybody help me?
[DllImport("IHUAPI.dll")]
public static extern int ihuConnect(String server,String
username,String password,ref long serverhandle);
This is the header file:
#define IHUAPI __stdcall
/*
** All possible errors returned by the API functions.
** These do not need to match system API
*/
typedef enum {
ihuSTATUS_OK = 0,
ihuSTATUS_FAILED = 100,
ihuSTATUS_API_TIMEOUT = 101,
ihuSTATUS_NOT_CONNECTED = 102,
ihuSTATUS_INTERFACE_NOT_FOUND = 103,
ihuSTATUS_NOT_SUPPORTED = 104,
ihuSTATUS_DUPLICATE_DATA = 105,
ihuSTATUS_NOT_VALID_USER = 106,
ihuSTATUS_ACCESS_DENIED = 107,
ihuSTATUS_WRITE_IN_FUTURE = 108,
ihuSTATUS_WRITE_ARCH_OFFLINE = 109,
ihuSTATUS_ARCH_READONLY = 110,
ihuSTATUS_WRITE_OUTSIDE_ACTIVE = 111,
ihuSTATUS_WRITE_NO_ARCH_AVAIL = 112,
ihuSTATUS_INVALID_TAGNAME = 113,
ihuSTATUS_LIC_TOO_MANY_TAGS = 114,
ihuSTATUS_LIC_TOO_MANY_USERS = 115,
ihuSTATUS_LIC_INVALID_LIC_DLL = 116,
ihuSTATUS_NO_VALUE = 117,
ihuSTATUS_NOT_LICENSED = 118,
ihuSTATUS_CALC_CIRC_REFERENCE = 119,
ihuSTATUS_DUPLICATE_INTERFACE = 120,
ihuSTATUS_BACKUP_EXCEEDED_SPACE = 121,
ihuSTATUS_INVALID_SERVER_VERSION = 122,
ihuSTATUS_DATA_RETRIEVAL_COUNT_EXCEEDED = 123,
ihuSTATUS_INVALID_PARAMETER = 124,
ihuSTATUS_MAX_ERROR_NUM = 124
} ihuErrorCode;
/* for connecting to one server */
ihuErrorCode IHUAPI ihuConnect
(
char * server,
char * username,
char * password,
long * serverhandle
);