CString link error in VC7 with MFC extersion dll which export functions using CString as parameter

F

flyingxu

Hi,
I run into a cstring related link problem in VC7.
My solution has 3 projects, one MFC exe, two MFC extersion DLL.
the two MFC extersion DLL export functions which use CString as
parameters.
Everything is fine in VC6.
Now I want to upgrade the solution to VC7, but I got lots of link error
like this,
/*
WinGPC5.obj : error LNK2019: unresolved external symbol "public: static
void __cdecl CHelp::SetHelpPath(class ATL::CStringT<unsigned
short,class StrTraitMFC<unsigned short,class ATL::ChTraitsCRT<unsigned
short> > > const &)"
(?SetHelpPath@CHelp@@SAXABV?$CStringT@GV?$StrTraitMFC@GV?$ChTraitsCRT@G@ATL@@@@@ATL@@@Z)
referenced in function "public: virtual int __thiscall
CWinGPC5App::InitInstance(void)" (?InitInstance@CWinGPC5App@@UAEHXZ)
LadderFrame.obj : error LNK2001: unresolved external symbol "public:
virtual class ATL::CStringT<unsigned short,class StrTraitMFC<unsigned
short,class ATL::ChTraitsCRT<unsigned short> > > __thiscall
CBCGPMDIChildWnd::GetFrameText(void)const "
(?GetFrameText@CBCGPMDIChildWnd@@UBE?AV?$CStringT@GV?$StrTraitMFC@GV?$ChTraitsCRT@G@ATL@@@@@ATL@@XZ)
*/
Some exported function which use CString as parameter can't be found.
If I change the parameter from CString to int for testing, it's ok.

I searched on web and find Q309801 by MS, but it doesn't help(it's for
CString derived class, not exported functions with CString parameters.)
Maybe I didn't fully follow its steps.

On the web, there's someone esle has the same problem as I do:
http://groups-beta.google.com/group...ad/794162cecea3b89e/397ad5a634581653?hl=en-us

Has MS be awared of this?
 
B

Bob Milton

Did you recompile everything with VC7? You CANNOT mix MFC Dlls from VC6
and VC7 (and the error you are getting says it can't find a VC7 CString
function - sounds like your Dlls are still VC6)
Bob
 
G

Guest

Yes, I think I tried 'rebuild all' several times.
Even I create a totally new solution in VC7 with one MFC exe, and one MFC
extersion dll which export function with cstring parameter, I still get that
link error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top