i have to solve this prooblem now before i can solve my other problem..
so here it is:
my code cannot retrieve the function Create from my DLL.Code:this->hModule = ::LoadLibrary(sModule); if(!this->hModule) return false; this->pCreate = (bool(*)(HWND))::GetProcAddress(this->hModule, "Create"); if(!pCreate) return false; // we returned false here this->pDestroy = (void(*)())::GetProcAddress(this->hModule, "Destroy"); if(!pDestroy) return false; this->pMove = (void(*)(int, int, int, int))::GetProcAddress(this->hModule, "Move"); if(!pMove) return false; if(!this->pCreate(this->Handle())) return false; return true;
the dll is:
Code:#ifdef BUILD_DLL #define DLL_EXPORT __declspec(dllexport) #else #define DLL_EXPORT __declspec(dllimport) #endif bool DLL_EXPORT Create(HWND hParent); void DLL_EXPORT Destroy(); void DLL_EXPORT Move(int iX, int iY, int iW, int iH); #include "CView.hpp"i think i did something wrong. i checked if BUILD_DLL is defined. i checked if i loaded the right module. both are true. so i dont understand why i cannot retrieve the procedure adress of Create. i will try some EXPORT TABLE viewer to check some things.Code:#include "main.hpp" CAppView AppView; bool Create(HWND hParent) { return AppView.Create(hParent); } void Destroy() { AppView.Destroy(); } void Move(int iX, int iY, int iW, int iH) { AppView.Move(iX, iY, iW, iH); }
i checked with export viewer:so i still dont know why it fails to retrieveCode:_Z6CreateP6HWND__ (Ordinal: 2, Entry Point RVA: 12f4h (4,852))




Reply With Quote