473,806 Members | 2,346 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Possible to call old DLL with CString argument?

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::Set Alarm(class ATL::CStringT<c har,class
StrTraitMFC_DLL <char,class ATL::ChTraitsCR T<char> > > &,class
ATL::CTime,int, int,int,int,int ,class ATL::CStringT<c har,class
StrTraitMFC_DLL <char,class ATL::ChTraitsCR T<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

Nov 16 '05 #1
1 2356
>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
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 16 '05 #2

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

Similar topics

3
25557
by: Morten Overgaard | last post by:
Hi How do I convert a managed System::String to a CString. I need to handle unicode characters ( Japan and Chinese ) as well as "normal" ANSI characters. I have tried the following char* p = (char*)System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(
2
5242
by: Hai Ly Hoang [MT00KSTN] | last post by:
CString.FormatMessage and CString.Format has the same parameters and they seems to have to outcome. However, they coexist !. There must be some subtle different between they. Can you tell me the difference ? Thank a lot
3
2828
by: Taptu¶ | last post by:
Hi I have a problem. I have a function : void for3::drzewo() { m_lista.DeleteAllItems(); m_li.GetImageList();
11
2030
by: vbgunz | last post by:
Hello all, I am just learning Python and have come across something I feel might be a bug. Please enlightenment me... The following code presents a challenge. How in the world do you provide an argument for *arg4? ## ============================================================ def argPrecedence(par1, par2=0, par3=0, *par4, **par5): print 'par1 =', par1, ' # positional argument' print 'par2 =', par2, ' # keyword argument'
5
7252
by: Martin Jørgensen | last post by:
Hello again, Sorry to bother but I guess my C++ book isn't very good since it obviously contains errors so the program code doesn't work with g++. However I don't understand what the problem is. Last time the problem was that "using namespace std" apparently had a "link" class/object defined already. Now I get: error: no matching function for call to 'String::String(String)'
4
4760
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
7
6347
by: MeAgin | last post by:
Hi all, I want to call a classic ASP page from my vb.net code. How this can be done? Normally I would create an object from MSXML2.XMLHTTP and then call the Get method and the ResponseText wiuld have the return value. Thnaks. Nadee
3
2230
by: Josemi | last post by:
Hi!, I've got a great problem, and I don't have any idea how can I to solve it. I hope that there is a solution to solve it :-). Well. I've got an App UNICODE that call a routine in a dll MBCS: App UNICODE CString dir; bDameValorINI (dir, "Directorios", "Ejecutables", "C:\", true);
9
8090
by: Donos | last post by:
I have a CString with 100 characters. Now i want to make that to 2 lines. For example, CString str = "This is just a test to find out how to break a cstring"; I want this CString in the following format,
0
9719
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
9597
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
10366
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
10371
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7649
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
6877
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
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3850
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
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.