In xp 32bit, this line does not compile with the problem, but in Vista with a 64-bit line:
m_FuncAddr = ::GetProcAddress (somthing);
gives the following error:
error C2440: '=': cannot convert from 'FARPROC' to 'int (__cdecl *) (void)'
GetProcAddress is defined as
WINBASEAPI FARPROC WINAPI GetProcAddress (somthing)
And m_FuncAddr like
int (WINAPI *m_FuncAddr)();
From what I understand, both are stdcall's.
To avoid a mistake, I had to put
m_FuncAddr = (int (__cdecl *)(void))::GetProcAddress(somthing);
My question is:
If both m_FuncAddr and GetProcAddress have an agreement to call stdcall, why should I "revoke" it with cdecl?
Is it possible that the VS project parameter "default calling convention (which is set in cdecl) exceeded the assignment statute above?
Thanks in advance!
[change]
Clergy question:
On one side of the equation (say, side 1) we have
int __stdcall * m_FuncAddr
On the other hand (side 2)
INT_PTR far __stdcall GetProcAddress
So, how is it that I should throw side 2 with cdecl if both are stdcalls? Or am I not getting anything?