Possible to call old DLL with CString argument?

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
 
D

David Lowndes

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
 

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