Charger une dll (api windows)
Bonjour,
J'ai un problème pour utiliser une dll que j'ai créé.
Voici ma dll (en gros) :
Code:
1 2 3 4 5 6 7
| extern "C"
{
void __declspec(dllexport) WINAPI FonctionDLL1(HWND hWnd)
{
}
} |
Compilation : g++ -shared Adll.cpp -o Adll.dll
Et voici le code pour utiliser ma dll :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| hLibrary = LoadLibrary("Adll.dll"); //ça c'est bon
if (!hLibrary)
{
//erreur
}
hkprc=(HOOKPROC)GetProcAddress(hLibrary,(LPSTR)"FonctionDLL1");
printf("%d", GetLastError()); //127 : The specified procedure could not be found.
if (hkprc==0)
{
//hkprc vaut tjs 0 !
} |
Compilation : g++ A.cpp
Pourquoi la fonction getlastError me retourner un code 127 ?
Merci d'avance...