Possible to call old DLL with CString argument?

  • Thread starter Thread starter bo bjerkeholt
  • Start date Start date
B

bo bjerkeholt

Just check that I got this right.

I have an old DLL made in VC6 (no sources). Some of the methods have a
CString as argument.
No problem when using this from my VC6 application.

I migrated my VC6 application --> VC7 (VS 2003) and then I get an error at
link time saying something like
error LNK2001: unresolved external symbol "public: int __thiscall
CGMCAlarms::SetAlarm(class ATL::CStringT<char,class
StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > > &,class
ATL::CTime,int,int,int,int,int,class ATL::CStringT<char,class
StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > >)"

I've been digging around in various documents for aspects of migrating and
come to the conclusion that this is the way it is due to the redesign of
CString.

One solution for this might be to make a new wrapper DLL in VC6 with
identical methods but with CString changed to something else maybe BSTR,
char*, convert it to CString in the DLL and then call the original DLL.

Am I right or is the a better and much simpler solution ?

rdgs,
Bo
 
One solution for this might be to make a new wrapper DLL in VC6 with
identical methods but with CString changed to something else maybe BSTR,
char*, convert it to CString in the DLL and then call the original DLL.

Am I right or is the a better and much simpler solution ?

That seems a reasonable approach.

Dave
 
Back
Top