Errors with latest 64 bit sdk

Hi,

I am porting my application from 32-bit to 64-bit, I am getting following errors in release build with latest compiler(1.4.3.3,64 bit SDK and DDK). It is building successfully in debug mode.

nafxcw.lib(wingdi.obj) : error LNK2005: "public: void __cdecl CWnd:Tongue TiedcreenToClient(struct tagRECT *)const " (?ScreenToClient@CWnd@@QEBAXPEAUtagRECT@@@Z) already defined in MSIDialog.obj
nafxcw.lib(wingdi.obj) : error LNK2005: "public: void __cdecl CWnd::ClientToScreen(struct tagRECT *)const " (?ClientToScreen@CWnd@@QEBAXPEAUtagRECT@@@Z) already defined in PermissionDlg.obj
Creating library \ice\BUILDSHELF\Release\Setup\HPZwup40.lib and object \ice\BUILDSHELF\Release\Setup\HPZwup40.exp
\ice\BUILDSHELF\Release\Setup\HPZwup40.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

$(ICE_DIVISION)wup$(ICE_REV).exe - 3 error(s), 0 warning(s)

I am using both methods(ScreenToClient & ClientToScreen) in my application.

Can anybody help me to resolve this?

Thanks,
Kishore Wani

[2191 byte] By [KishoreWani] at [2008-1-10]
# 1
"I am porting my application from > 32-bit to 64-bit, I am getting > following errors in release build..."
Do you have a small test case that reproduces the problem? If you do could you post it?
MVPUser at 2007-8-21 > top of Msdn Tech,.NET Development,64-Bit .NET Framework Development....
# 2

I assume PSDK for Win2k3 SP1 build after 1260. A simpler workaround, just call Win32 API instead of MFC method. For example, if you have a call to

pParent->ScreenToClient(&rc);

may be replaced with

CRect* lpRect = &rc;
:: ScreenToClient(pParent->m_hWnd, (LPPOINT)lpRect);
:: ScreenToClient(pParent->m_hWnd, ((LPPOINT)lpRect)+1);
if (GetExStyle() & WS_EX_LAYOUTRTL)
CRect:: SwapLeftRight(lpRect);

This should unblock you for now.

Thanks,
Nikola Dudar
Program Manager
Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

NikolaDudar at 2007-8-21 > top of Msdn Tech,.NET Development,64-Bit .NET Framework Development....
# 3
Thanks Nikola,

It is working fine.
But why we need to use Win32 API instead of MFC.

Regards,
Kishore Wani

KishoreWani at 2007-8-21 > top of Msdn Tech,.NET Development,64-Bit .NET Framework Development....
# 4
This is a bug in PSDK. It was too late to fix it in SP1. It does not repro in Visual Studio.

THanks,
Nikola

NikolaDudar at 2007-8-21 > top of Msdn Tech,.NET Development,64-Bit .NET Framework Development....

.NET Development

Site Classified