473,386 Members | 1,803 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,386 software developers and data experts.

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(dllexport))
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.dll. 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\code\tests\test44\Debug\test44.exe',
Symbols loaded.

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

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

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

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

'test44.exe': Loaded 'C:\WINDOWS\SYSTEM32\mscoree.dll', No symbols loaded.

....

'test44.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\msco rwks.dll', No symbols
loaded.

'test44.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\msvc r71.dll', Symbols loaded.

'test44.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\fusi on.dll', No symbols
loaded.

'test44.exe': Loaded
'C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\msco rlib.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 1450

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

Similar topics

2
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...
7
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
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...
3
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...
7
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...
3
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...
0
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...
3
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 &...
8
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....
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
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
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,...

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.