Migration from VC++ 6 to Visual studio 2005
-
I am trying to migrate a VC++ 6 project to visual studio 2005. I have a static library migrated and compiled in visual studio 2005. When I try to compile my application I get the follow link error: error LNK2001: unresolved external symbol "public: virtual int __thiscall CUGCtrl::OnHint(int,long,int,class ATL::CStringT > > *)" (?OnHint@CUGCtrl@@UAEHHJHPAV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) The function declaration is: virtual int OnHint(int col,long row,int section,CString *string); The problem is related to the third parameter (CString *string). Thanks for the advice. Nandopo.
-
I am trying to migrate a VC++ 6 project to visual studio 2005. I have a static library migrated and compiled in visual studio 2005. When I try to compile my application I get the follow link error: error LNK2001: unresolved external symbol "public: virtual int __thiscall CUGCtrl::OnHint(int,long,int,class ATL::CStringT > > *)" (?OnHint@CUGCtrl@@UAEHHJHPAV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) The function declaration is: virtual int OnHint(int col,long row,int section,CString *string); The problem is related to the third parameter (CString *string). Thanks for the advice. Nandopo.
Hello, You can take a look to http://support.microsoft.com/default.aspx?scid=KB;EN-US;309801 There you can find some instructions for using CStrings. There is a change on the CString definition, so you have to place someting like this on your stdafx.h file: #if defined(_AFXDLL) && (_MFC_VER >= 0x0700) #pragma message ("Enablig CString from .net") #include template class __declspec(dllimport) CStringT > >; template class __declspec(dllimport) CSimpleStringT; #endif I hope this helps
-
Hello, You can take a look to http://support.microsoft.com/default.aspx?scid=KB;EN-US;309801 There you can find some instructions for using CStrings. There is a change on the CString definition, so you have to place someting like this on your stdafx.h file: #if defined(_AFXDLL) && (_MFC_VER >= 0x0700) #pragma message ("Enablig CString from .net") #include template class __declspec(dllimport) CStringT > >; template class __declspec(dllimport) CSimpleStringT; #endif I hope this helps
-
You may also find this useful for any other problems encountered in your migration. Breaking Changes in Visual C++[^]
Kevin