473,834 Members | 1,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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::SetHelpP ath(class ATL::CStringT<u nsigned
short,class StrTraitMFC<uns igned short,class ATL::ChTraitsCR T<unsigned
short const &)"
(?SetHelpPath@C Help@@SAXABV?$C StringT@GV?$Str TraitMFC@GV?$Ch TraitsCRT@G@ATL @@@@@ATL@@@Z)
referenced in function "public: virtual int __thiscall
CWinGPC5App::In itInstance(void )" (?InitInstance@ CWinGPC5App@@UA EHXZ)
LadderFrame.obj : error LNK2001: unresolved external symbol "public:
virtual class ATL::CStringT<u nsigned short,class StrTraitMFC<uns igned
short,class ATL::ChTraitsCR T<unsigned short __thiscall
CBCGPMDIChildWn d::GetFrameText (void)const "
(?GetFrameText@ CBCGPMDIChildWn d@@UBE?AV?$CStr ingT@GV?$StrTra itMFC@GV?$ChTra itsCRT@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/...81653?hl=en-us

Has MS be awared of this?

Dec 1 '06 #1
2 5477
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
<fl******@gmail .comwrote in message
news:11******** **************@ n67g2000cwd.goo glegroups.com.. .
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::SetHelpP ath(class ATL::CStringT<u nsigned
short,class StrTraitMFC<uns igned short,class ATL::ChTraitsCR T<unsigned
short const &)"
(?SetHelpPath@C Help@@SAXABV?$C StringT@GV?$Str TraitMFC@GV?$Ch TraitsCRT@G@ATL @@@@@ATL@@@Z)
referenced in function "public: virtual int __thiscall
CWinGPC5App::In itInstance(void )" (?InitInstance@ CWinGPC5App@@UA EHXZ)
LadderFrame.obj : error LNK2001: unresolved external symbol "public:
virtual class ATL::CStringT<u nsigned short,class StrTraitMFC<uns igned
short,class ATL::ChTraitsCR T<unsigned short __thiscall
CBCGPMDIChildWn d::GetFrameText (void)const "
(?GetFrameText@ CBCGPMDIChildWn d@@UBE?AV?$CStr ingT@GV?$StrTra itMFC@GV?$ChTra itsCRT@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/...81653?hl=en-us

Has MS be awared of this?

Dec 1 '06 #2
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.

"Bob Milton" wrote:
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
Dec 2 '06 #3

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

Similar topics

9
12242
by: Fausto Lopez | last post by:
I'm getting the following error: 'strlen' : cannot convert parameter 1 from 'class CString' to 'const char *' when I try to compile the following code: HRESULT AnsiToUnicode(CString pszA, LPOLESTR* ppszW) { ULONG cCharacters; DWORD dwError;
14
2847
by: Steve McLellan | last post by:
Hi, Sorry to repost, but this is becoming aggravating, and causing me a lot of wasted time. I've got a reasonably large mixed C++ project, and after a number of builds (but not a constant number) linking (and sometimes compiling) becomes immensely slow, and task manager shows that link.exe (or cl.exe) is barely using any processor time, but an awful lot of RAM (around 150-200MB). I'm going to keep an eye on page faults since I can't...
0
1057
by: Silly | last post by:
I am writing a MC++ wrapper for a native dll, that will be called by C# applications. One of the functions returns a CString parameter: long GetProductStringDescriptor(int DevID, CString& sDescriptor) My wrapper accepts a ref to a managed string (below) and needs to pass this into to function so it is changed and returned.
0
2262
by: npotnis | last post by:
Hi All, I am trying to compile an existing C++ unamanaged application with the /clr switch in VS.Net 2003, as I need to use managed extensions in the code. In a cpp file I have the following code : CString strRet; COleVariant var = m_pRSTFormList->GetFieldValue("FormName"); if(var.vt == VT_BSTR) strRet = var.pbVal;
4
4761
by: huguogang | last post by:
Just curious, any one know what the 3 part parameter "class CString filename" would mean. The code: int TestFunc(class CString filename) { fopen(filename, "w"); } Compile using Visaul C++, there is no complain about the defintion. But
4
10506
by: Susan Rice | last post by:
I'm new to using CString. Why won't the following compile? I'm using Microsoft Visual C++ 6.0 Line 37 which it complains about is the function: 37 CString ConvertFile(char *szFileName) I tried throwing in a bunch of #includes but didn't help. Here's the compiler errors: Compiling...
4
4925
by: sreenubkaimal | last post by:
Please help me with this.. I have a DLL created in Visual C++ 6.0 ( VS 6.0 ). I am trying to use this DLL in a new wrapper application written using Visual Studio .net 2003 (C++ - MFC). My DLL has many methods which uses CString as arguements and return values. At first, I got a Link error as
16
2824
by: Norman Diamond | last post by:
In an antique obsolete version of MFC, a CString expression could be subscripted in order to retrieve one element. Visual Studio 2005 defines CSimpleStringT::operator. At first glance it looks like it might have been intended to provide backwards compatibility for antique programs. But there seems to be no way to use it. CString s = _T("ab"); short i = 1; _TCHAR c = s;
4
5625
by: sebastian.dau | last post by:
Hello Newsgroup, I have a link error that I did not manage to fix. I basically consume a VC 8.0 C++ dll that exports a class with a method containing CString declaration as follows: class WarnErr { //...
0
9800
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9651
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10516
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7762
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6960
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5629
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5800
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3085
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.