Estou criando uma DLL que precisa exportar 11 funções do CEN/XFS, porém existe uma função que consome um arquivo de cabeçalho. Acho que o erro está em consumir um método de um cabeçalho que não está declarado no meu escopo, alguém pra ajudar ?
Essa dll irá se comunicar com o XFS Manager.
Meu código é esse (Minha DLL - dllmain.cpp):
HRESULT WINAPI WFPOpen ( HSERVICE hService, LPSTR lpszLogicalName, HAPP hApp, LPSTR lpszAppID, DWORD dwTraceLevel, DWORD dwTimeOut, HWND hWnd, REQUESTID ReqID, HPROVIDER hProvider, DWORD dwSPIVersionsRequired, LPWFSVERSION lpSPIVersion, DWORD dwSrvcVersionsRequired, LPWFSVERSION lpSrvcVersion)
{
printf("INTO WFPOpen");
WFSRESULT * lpWFSResult;
HRESULT result;
SYSTEMTIME st;
HRESULT rt;
GetSystemTime(&st);
//o erro ocorre aki
result = WFMAllocateBuffer(sizeof(WFSRESULT), WFS_MEM_ZEROINIT, (void**)&lpWFSResult);
if(result!=WFS_SUCCESS){
return WFS_ERR_INTERNAL_ERROR;
}
return WFS_SUCCESS;
}
Header file (XFSADMIN.H):
HRESULT extern WINAPI WFMAllocateBuffer(ULONG ulSize, ULONG ulFlags, LPVOID * lppvData);
Minha dll.h (11 métodos que serão exportados)
class DLLIMPORT DllClass
{
public:
HRESULT WINAPI WFPCancelAsyncRequest (HSERVICE hService, REQUESTID RequestID);
HRESULT WINAPI WFPClose (HSERVICE hService, HWND hWnd, REQUESTID ReqID);
HRESULT WINAPI WFPDeregister (HSERVICE hService, DWORD dwEventClass, HWND hWndReg, HWND hWnd, REQUESTID ReqID);
HRESULT WINAPI WFPExecute (HSERVICE hService, DWORD dwCommand, LPVOID lpCmdData, DWORD dwTimeOut, HWND hWnd, REQUESTID ReqID);
HRESULT WINAPI WFPGetInfo (HSERVICE hService, DWORD dwCategory, LPVOID lpQueryDetails, DWORD dwTimeOut, HWND hWnd, REQUESTID ReqID);
HRESULT WINAPI WFPLock (HSERVICE hService, DWORD dwTimeOut, HWND hWnd, REQUESTID ReqID);
HRESULT WINAPI WFPOpen (HSERVICE hService, LPSTR lpszLogicalName, HAPP hApp, LPSTR lpszAppID, DWORD dwTraceLevel, DWORD dwTimeOut, HWND hWnd, REQUESTID ReqID, HPROVIDER hProvider, DWORD dwSPIVersionsRequired, LPWFSVERSION lpSPIVersion, DWORD dwSrvcVersionsRequired, LPWFSVERSION lpSrvcVersion);
HRESULT WINAPI WFPRegister (HSERVICE hService, DWORD dwEventClass, HWND hWndReg, HWND hWnd, REQUESTID ReqID);
HRESULT WINAPI WFPSetTraceLevel (HSERVICE hService, DWORD dwTraceLevel);
HRESULT WINAPI WFPUnloadService ();
HRESULT WINAPI WFPUnlock (HSERVICE hService, HWND hWnd, REQUESTID ReqID);
};
Porém ocorre esse erro ao compilar a DLL.
Mais precisamente aqui:
$(CPP) -shared $(LINKOBJ) -o $(BIN) $(LIBS) -Wl,--output-def,$(DEF),--out- implib,$(STATIC),--add-stdcall-alias