why typedef? and not a pointer to function?
hi,
i'm tryinfg to load a function from a dll, this dll haves a function
in my client program when i try to load the function why i cant use or define a pointer to that function when retrieving from GetProcAddress()?
ok a little bit more clear:
Code:
//pointer to the function to retrieve
void(* ptrFunc)(void) = NULL;
...
ptrFunc = GetProcAddress(dllLib,"mensaje");
//here compiler generates an error
but if i use typedef everything is fine
Code:
...
typedef void(WINAPI*ptrFunc)();
...
ptrFunc funcion1;
funcion1 = (ptrFunc)GetProcAddress(dllLib,"mensaje");
so why cant use a pointer to the function to handle with the GetProcAdress() return value?
GetProcAdress() returns a pointer to the specified function no?
one more question:
what
Code:
typedef void(WINAPI*ptrFunc)();
means?
im aliassing a pointer to a WINAPI function that returns no value and gets no value? is that what it means?
thanks for any help why i need to define a typedef
please excuse my poor english