//{{AFX_MSG(CHsmApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#if defined(__cplusplus)
extern "C"{
#endif
DLLEXPORT_API int _stdcall get_MD5(unsigned char*Strin,int Datalen,BYTE* Dataout);
DLLEXPORT_API int _stdcall hsmopen(char * Ipadd,u_short Port);
DLLEXPORT_API int _stdcall hsmenc_ZMK(BYTE* Indata,short Keyindex,short DataLen,BYTE* Resp);
DLLEXPORT_API int _stdcall hsmdec_ZMK(BYTE* Indata,short Keyindex,short DataLen,BYTE* Resp);
DLLEXPORT_API void _stdcall hsmclose();
DLLEXPORT_API int _stdcall DT_Pro(BYTE* Indata,short DataLen, WORD iMode,BYTE* Output);
DLLEXPORT_API int _stdcall zmk_test(short Keyindex);
#if defined(__cplusplus)
}
#endif
編譯運行如下:
--------------------Configuration: test - Win32 Debug--------------------
Compiling...
testDlg.cpp
c:\zhanyan\系統\小工具\hsmcode\hsm\test\hsm_api.h(53) : error C2144: syntax error : missing ';' before type 'int'
c:\zhanyan\系統\小工具\hsmcode\hsm\test\hsm_api.h(53) : error C2501: 'DLLEXPORT_API' : missing storage-class or type specifiers
c:\zhanyan\系統\小工具\hsmcode\hsm\test\hsm_api.h(53) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
test.exe - 3 error(s), 0 warning(s)
報錯提示的是如下這個函式int前丟失;,看來看去都沒看出啥問題,全部去掉DLLEXPORT_API,那就都沒問題了。
DLLEXPORT_API int _stdcall get_MD5(unsigned char*Strin,int Datalen,BYTE* Dataout);