stdcall over-ride by visual studio?

In xp 32bit this line compiles with not problem however in vista 64bit this 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 as int (WINAPI *m_FuncAddr)(); From what I understand both are stdcall's. To avoid the error I had to put m_FuncAddr = (int (__cdecl *)(void))::GetProcAddress(somthing); My Question: If both m_FuncAddr and GetProcAddress have the stdcall calling convention why do I have to 'recall' it with cdecl ? Is it possible that the VS project setting 'default calling convention (which is set to cdecl) over-rides the assignemet statment above ? Thanks in advance! [Edit] To clerfiy the question: On one side of the equation (say side 1) i have int __stdcall * m_FuncAddr On other side (side 2) INT_PTR far __stdcall GetProcAddress So how is it that i have to cast side 2 with cdecl if both are stdcalls ? Or am I not getting something ?
My answer still stands after your edit, int and INT_PTR are very different in 64-bit builds!

以上就是stdcall over-ride by visual studio?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准