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 EntryPointNotFo undException, 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("IHUA PI.dll")]
public static extern int ihuConnect(Stri ng 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_FAILE D = 100,
ihuSTATUS_API_T IMEOUT = 101,
ihuSTATUS_NOT_C ONNECTED = 102,
ihuSTATUS_INTER FACE_NOT_FOUND = 103,
ihuSTATUS_NOT_S UPPORTED = 104,
ihuSTATUS_DUPLI CATE_DATA = 105,
ihuSTATUS_NOT_V ALID_USER = 106,
ihuSTATUS_ACCES S_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_INVAL ID_TAGNAME = 113,
ihuSTATUS_LIC_T OO_MANY_TAGS = 114,
ihuSTATUS_LIC_T OO_MANY_USERS = 115,
ihuSTATUS_LIC_I NVALID_LIC_DLL = 116,
ihuSTATUS_NO_VA LUE = 117,
ihuSTATUS_NOT_L ICENSED = 118,
ihuSTATUS_CALC_ CIRC_REFERENCE = 119,
ihuSTATUS_DUPLI CATE_INTERFACE = 120,
ihuSTATUS_BACKU P_EXCEEDED_SPAC E = 121,
ihuSTATUS_INVAL ID_SERVER_VERSI ON = 122,
ihuSTATUS_DATA_ RETRIEVAL_COUNT _EXCEEDED = 123,
ihuSTATUS_INVAL ID_PARAMETER = 124,
ihuSTATUS_MAX_E RROR_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 EntryPointNotFo undException, 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("IHUA PI.dll")]
public static extern int ihuConnect(Stri ng 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_FAILE D = 100,
ihuSTATUS_API_T IMEOUT = 101,
ihuSTATUS_NOT_C ONNECTED = 102,
ihuSTATUS_INTER FACE_NOT_FOUND = 103,
ihuSTATUS_NOT_S UPPORTED = 104,
ihuSTATUS_DUPLI CATE_DATA = 105,
ihuSTATUS_NOT_V ALID_USER = 106,
ihuSTATUS_ACCES S_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_INVAL ID_TAGNAME = 113,
ihuSTATUS_LIC_T OO_MANY_TAGS = 114,
ihuSTATUS_LIC_T OO_MANY_USERS = 115,
ihuSTATUS_LIC_I NVALID_LIC_DLL = 116,
ihuSTATUS_NO_VA LUE = 117,
ihuSTATUS_NOT_L ICENSED = 118,
ihuSTATUS_CALC_ CIRC_REFERENCE = 119,
ihuSTATUS_DUPLI CATE_INTERFACE = 120,
ihuSTATUS_BACKU P_EXCEEDED_SPAC E = 121,
ihuSTATUS_INVAL ID_SERVER_VERSI ON = 122,
ihuSTATUS_DATA_ RETRIEVAL_COUNT _EXCEEDED = 123,
ihuSTATUS_INVAL ID_PARAMETER = 124,
ihuSTATUS_MAX_E RROR_NUM = 124
} ihuErrorCode;
/* for connecting to one server */
ihuErrorCode IHUAPI ihuConnect
(
char * server,
char * username,
char * password,
long * serverhandle
);
Comment