473,698 Members | 2,508 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

howto: link and load mc++ dlls from unmanaged app

Hello,

Am I mistaken in thinking that if I have a mc++ dll that I should be able to
link against it (so long as it has exported symbols via declspec(dllexp ort))
in an unmanaged application?

I am currently testing this and it fails. I have a native, unmanaged test
application that links against my mc++ dll with a function entry point.
Linking works fine, no errors. When I try to run in the debugger I see the
output below (abreviated for clarity).

test44.exe is my (native) test app. It clearly loads first ntdll.dll and
kernel32.dll. Then it loads one of my native dlls, txfoundation.dl l. This
dll is linked against the mc++ compiled utilities_c.dll , which then brings
in mscoree.dll. Various other dlls are loaded (all native) and then at the
end it tries to load mscorwks.dll, msvcr71.dll, fusion.dll, and finally
mscorlib.dll. I'm assuming that the exception occurs while attempting to
load mscorlib.dll.

I thought that this should be possible. If not, how do I write a native
application that can link and load a managed c++ compiled dll (which has
references to various other managed assemblies)? I assume this is possible?

Pointers, help is appreciated. Thanks!

-Eric Twietmeyer

PS I can of course provide more details as necessary, for instance compile
and link options for the various pieces....
'test44.exe': Loaded 'K:\home\ept\co de\tests\test44 \Debug\test44.e xe',
Symbols loaded.

'test44.exe': Loaded 'C:\WINDOWS\SYS TEM32\ntdll.dll ', No symbols loaded.

'test44.exe': Loaded 'C:\WINDOWS\SYS TEM32\KERNEL32. DLL', No symbols loaded.

'test44.exe': Loaded 'Z:\dll\bin\txf oundation.dll', Symbols loaded.

'test44.exe': Loaded 'Z:\dll\bin\uti lities_c.dll', Symbols loaded.

'test44.exe': Loaded 'C:\WINDOWS\SYS TEM32\mscoree.d ll', No symbols loaded.

....

'test44.exe': Loaded
'C:\WINDOWS\Mic rosoft.NET\Fram ework\v1.1.4322 \mscorwks.dll', No symbols
loaded.

'test44.exe': Loaded
'C:\WINDOWS\Mic rosoft.NET\Fram ework\v1.1.4322 \msvcr71.dll', Symbols loaded.

'test44.exe': Loaded
'C:\WINDOWS\Mic rosoft.NET\Fram ework\v1.1.4322 \fusion.dll', No symbols
loaded.

'test44.exe': Loaded
'C:\WINDOWS\Mic rosoft.NET\Fram ework\v1.1.4322 \mscorlib.dll', No symbols
loaded.

First-chance exception at 0x00000000 in test44.exe: 0xC0000005: Access
violation reading location 0x00000000.

First-chance exception at 0x791b970e in test44.exe: 0xC0000005: Access
violation reading location 0x000001a6.

The thread 'Win32 Thread' (0x4d0) has exited with code -2146233082
(0x80131506).

The thread 'Win32 Thread' (0x69c) has exited with code -2146233082
(0x80131506).

The program '[2668] test44.exe: Native' has exited with code -2146233082
(0x80131506).
Nov 17 '05 #1
0 1465

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

Similar topics

2
1554
by: faktujaa | last post by:
Hi All, I have to avoid cyclic reference in my DLLS. One way is to move the code to the common DLL. But now since i have written a lot of code, it would take a whole lot of time to do this. The other way i see is to link file to the DLL. But i have some doubts about taking this approach. 1. Since all my DLLs are on the same server now, its not a problem but what if later i try to seperate out this DLLs on different servers for load...
7
4380
by: BekTek | last post by:
When I build boost libs, I realized that there is static link at runtime.. What does that mean? I thought static linking is done at compile time. Am I wrong?
8
21242
by: ATS | last post by:
HOWTO Implement LoadLibrary\GetProcAdrress\FreeLibrary in C# Please help, I want to fully implement LoadLibrary\GetProcAdrress\FreeLibrary in C#, and be able to call functions that I use GetProcAddress on to pass info to non-.NET apps. I can not use the standard "interop" process, as the DLL's are created dynamically. I need this: ========================================
3
1527
by: Lord2702 | last post by:
Sun. Aug. 22, 2004 2:20 PM PT How to create multifile assembly in Managed Visual C++ ? Using VSIDE. Please do not point me to MSDN pages, I already read those pages, and it only says, that you can create, (but no info, or steps how to create?) it in VSIDE, but no STEPS are given. I want this solution Only and Only in Managed VC++, with the use of VSIDE. Also as VSIDE 2003 is unable to create MakeFile, like VSIDE VC++ 6.0, MakeFile...
7
1742
by: Kristof Thys via .NET 247 | last post by:
Post a new message to microsoft.public.dotnet.languages.vc http://www.dotnet247.com/247reference/default.aspx Hello, I've been struggling for weeks with this problem, I hope I find some help here...
3
1752
by: Clift Norris | last post by:
I've created a managed C++ assembly containing a managed class that is instantiated from ASP.NET. The managed C++ assembly needs msvcp71.dll and msvcr71.dll. When ASP.NET loads the assembly, it cannot locate the C++ runtime DLLs and hence throws an exception. I have placed the C++ runtime DLLs in the same directory as the managed C++ assembly. Does anyone know why ASP.NET can't find these C++ runtime DLLs? If I place the C++...
0
1607
by: Maxwell | last post by:
Hello, I recently completed a MC++ (VS2003) DLL that wraps a non MFC C++ DLL and need to use it in a MC++ Console Application (no forms/guis of any kind just output to console). Trouble is that when I ran it and looked at memory usage (in Windows task manager) it looked as if there was a very slow leak. To isolate the issue:
3
2711
by: gopal | last post by:
I am developing an application in CSharp - windows forms based, which copies the DLLs both unmanaged and managed DLLs from a shared folder and will overwrite the existing versions of managed & unmanaged DLLs into folder where some .NET application and a VB application has been installed. To be more clear, i will make some chnages to DLLs and using this tool(developed in CSharp) i will overwrite the existing version of DLLs - unmanaged...
8
1640
by: STG | last post by:
Greetings, My group has an SDK that was developed 5 years ago with VC++ 6. Over the last years, the requests for a VS.NET SDK has reached critical mass and I am now in the process of doing that. Actually, the first release of this 'port' is be a simple rebuild of the unmanaged C++ SDK in VS.NET. I have done this part already, using VS.NET 2003.
0
9171
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9032
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...
0
7743
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6532
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
5869
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
4373
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...
1
3053
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
2
2342
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2008
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.