473,385 Members | 1,564 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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


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?$CS tringT@GV?$StrTraitMFC_DLL@GV?$ChTraitsCRT@G@ATL@@ @@@ATL@@HPAH@Z)
referenced in function "int __cdecl CmdPlaySound(class CHPCmdExecFrame *,void
*,class CHPCpDlcWnd *)"
(?CmdPlaySound@@YAHPAVCHPCmdExecFrame@@PAXPAVCHPCp DlcWnd@@@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
Nov 17 '05 #1
2 2388
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

Nov 17 '05 #2
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
Pazarbasi" wrote:
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

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Pascal Cloup | last post by:
Hello, I write a Dll of managed C++ class that contains a piece of code like the following liines. This code always fails when attempting to create a new not managed class. Someone has an...
0
by: Pat Sagaser via .NET 247 | last post by:
I'm using a repeater with a dynamic template. I don't know the fields to display (or how many) until runtime. I have everything working except for linking Button events to the repeaters ItemCommand...
5
by: Dan Nash | last post by:
Hi all, I've got a page with a user control on, added via VS. I'm trying to get to a property of the user control (or more precisely, a public var). Here's the code at the top of my aspx...
2
by: Brian Anderson | last post by:
Hello, is it possible to use DllImport to call a DLL in ASP.NET ? Or is it necessarry that my DLL has to be copied into \System32 ? My DLL is a native C++ 7.1 DLL (not managed, no COM, no...
3
by: dhnriverside | last post by:
Hi guys I'm trying to implement an external class (.cs) for popping a window and doing various bits and peices. I want to pass to the overloaded constructor a reference to the page that called...
6
by: Ken | last post by:
When running a program in the debugger, what would cause it to crash without any error messages? I get "The program has exited with code 0 (0x0)". The program is a MDI app with threading for...
9
by: Gnic | last post by:
Hi, I have a (Complied) C Library that needs to be called using c# code, some of the function require char* parameter(in and out) Here is the problem, There is a function that expect an...
3
by: ricolee99 | last post by:
Hi everyone, I have a problem that i have been trying to solve for awhile. I'm given a code where the purpose is to create a general dataset mapper. Given any dataset, i have a class,...
2
by: ʹÃûÑï | last post by:
In vs.net2003£¬there is a code like this admin_left.aspx <%if(CanSee(1,14)) { %> <tr> <td align="center" background="images/home_40.gif"><A href="admin_list.aspx?boardid=78"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.