Buongiorno a tutti,
stavo cercando di capire come vengono importate dinamicamente le funzioni dalle librerie DLL quando mi sn imbattuto in questo errore di debug:
The value of ESP was not properly saved across function call..ecc ecc
Il codice del mio programma è questo
dove sbaglio?? :master:codice:#include "stdafx.h" #include <stdio.h> #include <windows.h> typedef HGLOBAL (*GLOBALALLOC)(UINT,SIZE_T); int main(){ GLOBALALLOC MyGlobalAlloc; MyGlobalAlloc=(GLOBALALLOC)GetProcAddress(LoadLibrary("Kernel32.dll"),"GlobalAlloc"); char *rrr=(char *)MyGlobalAlloc(GPTR,sizeof(char)*2); return 0; }

Rispondi quotando