473,399 Members | 3,656 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,399 software developers and data experts.

Linking VC6 with VC7 DLL

Is it possible to statically link an application compiled in VC6 with a managed DLL ?

I have a very large VC6 (MFC) app, which I can't convert to VC7 at the moment. I need to be able to call a managed C++ DLL with some unmanaged exported functions. If I use LoadLibrary - it works, but I really would like to have it link statically with the application. The link completes without errors but at run-time I get this error:

"The application failed to initialize properly (0xc0000005). Click on
OK to terminate application."

The error occurs before any of my code is executed - apparently when the DLL is being loaded. If I build the DLL without the /clr flag, it works. The error happens only when the DLL is managed.

Any help would be greatly appreciated.

--
Message posted via http://www.dotnetmonster.com
Nov 17 '05 #1
2 992
No, this is not reliably possible. The startup code needs to be aware of the
CLR. The 6.0 generated code by definition is not.

Ronald Laeremans
Visual C++ team

"iZik via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in message
news:ee******************************@DotNetMonste r.com...
Is it possible to statically link an application compiled in VC6 with a
managed DLL ?

I have a very large VC6 (MFC) app, which I can't convert to VC7 at the
moment. I need to be able to call a managed C++ DLL with some unmanaged
exported functions. If I use LoadLibrary - it works, but I really would
like to have it link statically with the application. The link completes
without errors but at run-time I get this error:

"The application failed to initialize properly (0xc0000005). Click on
OK to terminate application."

The error occurs before any of my code is executed - apparently when the
DLL is being loaded. If I build the DLL without the /clr flag, it works.
The error happens only when the DLL is managed.

Any help would be greatly appreciated.

--
Message posted via http://www.dotnetmonster.com

Nov 17 '05 #2
If LoadLibrary works for you, I think you can use delayed loading of your
DLL to emulate static linking.
"iZik via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in message
news:ee******************************@DotNetMonste r.com...
Is it possible to statically link an application compiled in VC6 with a managed DLL ?
I have a very large VC6 (MFC) app, which I can't convert to VC7 at the moment. I need to be able to call a managed C++ DLL with some unmanaged
exported functions. If I use LoadLibrary - it works, but I really would like
to have it link statically with the application. The link completes without
errors but at run-time I get this error:
"The application failed to initialize properly (0xc0000005). Click on
OK to terminate application."

The error occurs before any of my code is executed - apparently when the DLL is being loaded. If I build the DLL without the /clr flag, it works. The
error happens only when the DLL is managed.
Any help would be greatly appreciated.

--
Message posted via http://www.dotnetmonster.com

Nov 17 '05 #3

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

Similar topics

0
by: Wolfgang | last post by:
I have a problem with linking my CPP Code under a irix6 machine (sgi, UNIX). In my CPP code I use some Functions which are written in Python. So its a kind of CPP wrapper for my Python functions In...
0
by: Dibyendu Roy | last post by:
Hi All, I build an object called "dblorcle" to connect to oracle database in Sun solaris box. This is built linking with various oracle ".a" (archived, for static linking) files come with standard...
7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
2
by: sunil | last post by:
Hi, We have lot of c and fortran archive libraries that have complex dependencies. We have different server tasks that use some of these libraries. We have developed a tool inhouse that links...
20
by: Steven T. Hatton | last post by:
I just read this in the description of how C++ is supposed to be implemented: "All external object and function references are resolved. Library components are linked to satisfy external...
0
by: gasturbtec | last post by:
please help im new at access programming and i just got this project dropped in my lap because the old programmer quit. i've been doing ok so far but now i need to add code to an existing database...
6
by: Rudy Ray Moore | last post by:
I work with a multi-project workspace. One project (the "startup" project) has a "Configuration Type" of "Application (.exe)". The other 40 projects have a "Configuration Type" of "Static Library...
0
by: Rudy Ray Moore | last post by:
I've been having trouble getting incremental linking to work under Visual C++ .net 2003 7.1 for my multi-project workspace. Ronald Laeremans and Carl Daniel (and a few others) helped me figure it...
0
by: Philip Lowman | last post by:
I am in the process of trying to migrate a couple of build solutions to Visual Studio Express 2005 from VS 2003 Professional and I am running into a weird C/C++ runtime library linking issue when...
1
by: srikar | last post by:
what is the difference between static linking & dynamic linking, what are the advantages of each? How to perform static linking & Dynamic linking by using gcc -o liniking will be done , but...
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
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...
0
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...
0
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
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...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.