473,505 Members | 13,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dllexport for vc 6.0 c++

Hi all,

I needed a way to provide vc 6.0 c++ code a way to call managed dlls
compiled in vs 2003. In order to do this I created a wrapper (in vs
2003) for the managed code and made the functions accessible with dll
export.

I then wrote a test application in vc 6.0 which included the .lib file
created from dllexport and called the managed code through it.
Everything works just fine. However, somehow it just seems a little
too good to be true. I'm wondering if I am going to pay for this
approach somewhere down the line.

Does anybody have experience with interoperability between vs6 and vs7
code? Your comments are most welcome.

Thanks,

Henri

Feb 8 '07 #1
2 1132
I needed a way to provide vc 6.0 c++ code a way to call managed dlls
compiled in vs 2003. In order to do this I created a wrapper (in vs
2003) for the managed code and made the functions accessible with dll
export.

I then wrote a test application in vc 6.0 which included the .lib file
created from dllexport and called the managed code through it.
Everything works just fine. However, somehow it just seems a little
too good to be true. I'm wondering if I am going to pay for this
approach somewhere down the line.

Does anybody have experience with interoperability between vs6 and vs7
code? Your comments are most welcome.
Hi,

Yes, Life can really be that good. As long as you live by the following
rules, everything is hunky-dory:
- do not deallocate memory that was allocated in another module.
- do not use classes in your public interface. Only plain C functions and
plain old data arguments.
- do not let exceptions escape beyond module boundaries. Use simple return
values.

All praise the power of Visual C++ :-)

--

Kind regards,
Bruno van Dooren
br**********************@hotmail.com
Remove only "_nos_pam"
Feb 8 '07 #2

"Bruno van Dooren [MVP VC++]" <br**********************@hotmail.comwrote
in message news:eG**************@TK2MSFTNGP03.phx.gbl...
>I needed a way to provide vc 6.0 c++ code a way to call managed dlls
compiled in vs 2003. In order to do this I created a wrapper (in vs
2003) for the managed code and made the functions accessible with dll
export.

I then wrote a test application in vc 6.0 which included the .lib file
created from dllexport and called the managed code through it.
Everything works just fine. However, somehow it just seems a little
too good to be true. I'm wondering if I am going to pay for this
approach somewhere down the line.

Does anybody have experience with interoperability between vs6 and vs7
code? Your comments are most welcome.

Hi,

Yes, Life can really be that good. As long as you live by the following
rules, everything is hunky-dory:
- do not deallocate memory that was allocated in another module.
- do not use classes in your public interface. Only plain C functions and
plain old data arguments.
- do not let exceptions escape beyond module boundaries. Use simple return
values.
That advice will work great with VS2005 (vc8). vc7 though may cause random
failures due to things like bugs in the managed c++ runtime library relating
to loader lock, and syntax that lets you pass unpinned managed objects to
native functions.
>
All praise the power of Visual C++ :-)

--

Kind regards,
Bruno van Dooren
br**********************@hotmail.com
Remove only "_nos_pam"

Feb 12 '07 #3

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

Similar topics

3
5299
by: Cengiz | last post by:
Hi, i've created DLL with VC++ 6.0 with the following code. -------------------------------------------------- int __declspec(dllexport) initialize(void) { MessageBox(0,"TEST","TEST",0);...
3
2584
by: Gawel | last post by:
Hajo, I have two dlls, both of them are compiled with /clr switch. In first dll project I have managed and unmanaged classes. One of the unmanaged I would like to use outside therefore I marked...
5
2204
by: Jason W | last post by:
I have a C# class that I wan't to be able to use in VB6 and VBA applications. To do this I was trying to use a mixed managed VC++ dll and export a function. Doing this I get an error "The memory...
8
12421
by: bonk | last post by:
Hello, I created a MFC extension dll (using VS 2005 Beta 2) that is supposed to export a class that uses .NET internally (See header below) und later shall be used by a plain MFC Project (without...
7
1897
by: Martin Pritchard | last post by:
Hi, Sorry for my ignorance, but I'm a bit new to C++. I've been handed over a C++ app written in VS2002 which I have to convert to VS2005. Apparently it's been written in a C style, but cannot...
3
12413
by: majestik666 | last post by:
Hi, i'm bulding a multi platform app under windows/linux/osx an i have a bit of trouble exporting c++ symbols from a dynamic library... Under windows, i compile a dll exporting symbols using :...
2
5108
by: Luis | last post by:
Hello... How can I do an exported function in Visual Basic.Net? In Visual C++ the source is the next... but I need the same in VB.Net Thank you /* This is an example of an exported...
2
1748
by: Bit Byte | last post by:
I have written a Dll which contains a class. I overload the "<<" opertor in global functions to perform Ostream operations - a follows: ostream &operator << (ostream &os, const struct _mystruct_t...
1
6264
by: =?Utf-8?B?RmFiaWFu?= | last post by:
Hello, I want to give multiple native classes (in different mixed mode dlls) access to a managed output window (for error messages). Therefore I wrote a native singleton with __declspec...
0
7298
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7366
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...
1
7017
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...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
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...
0
4698
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...
0
3187
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...
0
1526
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 ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.