Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionMAIN.CPP #include "main.h" using namespace std; int main() { typedef int (__stdcall* MYDLLFUNC)(const char*); HINSTANCE hDLL; MYDLLFUNC ImpFuncDLL; int res; hDLL = LoadLibrary(L"MADLL"); if (hDLL != NULL) { ImpFuncDLL = (MYDLLFUNC)GetProcAddress(hDLL, "Mafonction@4"); if (!ImpFuncDLL) { cout<<"error"<<endl; FreeLibrary(hDLL); return 1; } else { res = ImpFuncDLL("blob"); FreeLibrary(hDLL); return 0; } } }
MADLL.H extern "C" { __declspec(dllexport) int __stdcall MaFonction(const char* name); ... }
MADLL.H using namespace std; struct TestStruct; ...
MAIN.CPP int main() { HINSTANCE hDLL; hDLL = LoadLibrary(L"MADLL"); if (hDLL != NULL) { TestStruct testStruct; } }
HMODULE hDLL = LoadLibrary(L"SE-Brain_Release.DLL");
ImpFuncDLL = (MYDLLFUNC)GetProcAddress(hDLL, "SEBrain_Sync_playTests");