473,385 Members | 1,661 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.

Calling Unmanaged C++ functions from Visual Studio .NET C++ App

Hi All,

I have an unmanaged C++ DLL built in Visual Studio 4.2. This DLL exports a
class, which I want to use in my VC++ .NET 2003 app.
Everything works fine however some of the methods in the exported class take
CString parameters. When I try using these I get a linker error as follows

Error LNK2001: unresolved external symbol "public: void __thiscall
niclt_clScriptEngine::SetIP(class ATL::CStringT<char,class
StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > >)"
(?SetIP@niclt_clScriptEngine@@$$FQAEXV?$CStringT@D V?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@ @Z)

I have search on Google and although I can find instances of where others
have found similar issue I have found no solution.
I have also tried the Microsoft recommendation in Article 309801 but this
does not work.
Has anyone any idea how to get around this problem.

Mike.

Feb 16 '06 #1
1 1269
>I have an unmanaged C++ DLL built in Visual Studio 4.2. This DLL exports a
class, which I want to use in my VC++ .NET 2003 app.
Everything works fine however some of the methods in the exported class take
CString parameters. When I try using these I get a linker error as follows


Mike,

Passing allocated object such as CStrings across the DLL boundary
implies that you have to use the C & MFC DLLs in order to share a
common memory manager. Since your VC4.2 application and your VC2003
application will be linking to different versions of their run-time
libraries, this isn't going to me a match made in heaven.

Basically I think the linker error is telling you you're onto a
non-starter.

If you rebuild your old project with VS2003 and ensure that both
projects are built with MFC as a shared DLL, you should be OK.

Dave
Feb 16 '06 #2

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

Similar topics

1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
0
by: Denis | last post by:
Hello, I am working on a large business application written mostly with VC++ and MFC. What I'm trying to do is accessing my database with the existing functions in my c++ application using XML...
15
by: Bryan | last post by:
I have a multi-threaded C# console application that uses WMI (System.Management namespace) to make RPC calls to several servers (600+ ) and returns ScheduledJobs. The section of my code that...
5
by: Tim Nelson | last post by:
Hi, I've got a legacy application written in C. I'd like to evolve the product (as opposed to completely rewriting it) by adding new features using C#. Is this possible? I know I should be able...
1
by: Jesse McGrew | last post by:
Hi all, I'm trying to make a plugin DLL for a third-party application, using VC++ .NET 2003. This DLL acts as a bridge between the C++ plugin API of the application, and my actual plugin code...
3
by: Gustavo L. Fabro | last post by:
Greetings! I'm a newbie in Visual C++ .NET (have programmed in Borland C++ and Builder for long) and I am trying to do a very simple thing, but I'm stuck. I created an (unmanaged) DLL project...
1
by: H.B. | last post by:
Hi, I need to make a function that can display data on my Managed C++ app and be called by an unmanaged C++ DLL. Something like : void Form1::Form1_Load(System::Object * sender,...
2
by: andanb | last post by:
Hi all, I have been struggling with the following problem: - How can I create a C++ dll in Microsoft Visual Studio? - How can I call the dll from C#? I would really appreciate your help! ...
0
by: =?Utf-8?B?UGFy?= | last post by:
Hi I have a question on how to import unmanaged DLLs into Visual Studio 2005, C# environment. The background is that an instrument we bought is controlled through a couple of DLL files. I...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.