Urgent: Linking Error :__declspec(dllimport) public: class ATL::CS

G

Guest

Hi ,

While upgrading my application from vc6 to vc7 I got followin linking errors :

__declspec(dllimport) public: class ATL::CStringT<unsigned short,class
StrTraitMFC_DLL<unsigned short,class ATL::ChTraitsCRT<unsigned short> > >
__thiscall CHPCmdExecFrame::GetStringParam(int,int *)"
(__imp_?GetStringParam@CHPCmdExecFrame@@QAE?AV?$CStringT@GV?$StrTraitMFC_DLL@GV?$ChTraitsCRT@G@ATL@@@@@ATL@@HPAH@Z)
referenced in function "int __cdecl CmdPlaySound(class CHPCmdExecFrame *,void
*,class CHPCpDlcWnd *)"
(?CmdPlaySound@@YAHPAVCHPCmdExecFrame@@PAXPAVCHPCpDlcWnd@@@Z)

I Also tried following workaround from microsoft:

******************************************************
To resolve this issue, explicitly import the template class for CStringT and
CSimpleStringT in the precompiled header (stdafx.h) file, as follows:
template class __declspec(dllimport) CStringT<TCHAR, StrTraitMFC<TCHAR,
ChTraitsCRT<TCHAR> > >;
template class __declspec(dllimport) CSimpleStringT<TCHAR>;
******************************************************

But it doesn't work . i also tried including

#include <atlstr.h>
#include <cstringt.h>

Error still persists.

Any workaroud to this problem would be a great help. The application works
fine on VC6


Thanks in advance,

Arun
 
I

Ismail Pazarbasi

Are you using MFC? Please paste your stdafx.h and preprocessor
defintions here.

I have migrated an application from VC6 to VC71, and I have never
encountered with such a problem. Perhaps, it's related to directives.

Ismail
 
G

Guest

Hi Ismail,

Problem was related to CString Class.

In my code, I was using some of our vc6 dlls which exports class derived
from CString.

Definition of CString in vc6 and vc7 is different.

Earlier it was a MFC class and now it is Template Class.

I first built all it's dependencies(.dll's) on vc7 and then built
problamatic module.

now it's workig fine.

Thanks a lot for offering help!

-Arun
 

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