Some follow up information. I moved my native entry points to the manifest-containing-module. So I
have a 3 file assembly: 1 .netmodule for C#, 1 .netmodule (but with a .dll extension) which
contains nearly all of the logic that is written in C++, and the assembly file itself which contains
the native .DLL exports. Modules 2 and 3 work around the CLR 1.1 "Mixed DLL loading problem" in the
normal way.
When I try to load this extension, it crashes the process. The host program is doing a LoadLibrary
on my main assembly file. The debugger seems generally erratic and untrustworthy while I've been
trying to figure this out, but I eventually managed to get this stack trace on the crash. Does
Module::BuildClassForModule simply NOT work for Mixed modules?
EEClass::NotifyDebuggerAttach() + 0x11
EEClass::NotifyDebuggerLoad() + 0x12
Module::BuildClassForModule() + 0x5da1b
Module::SetContainer() + 0x2daaf
Assembly::AddModule() + 0x139
BaseDomain::SetAssemblyManifestModule() + 0x20
BaseDomain::LoadAssembly() + 0x339
ExecuteDLL() + 0x7eee8
__CorDllMain@12() + 0x1c
_LdrpCallInitRoutine@16() + 0x14
_LdrpRunInitializeRoutines@4() + 0x32f
_LdrpLoadDll@24() + 0x372
_LdrLoadDll@16() + 0x1c5
_LoadLibraryExW@12() + 0xc8
_LoadLibraryExA@12() + 0x1d
_LoadLibraryA@4() + 0x2f
Bern McCarty
Bentley Systems, Inc.
"Bern McCarty" <be**********@bentley.com> wrote in message
news:uy*************@TK2MSFTNGP11.phx.gbl... I have a mixed DLL that "extends" an existing application and works just fine. It makes
significant use of IJW to interact with the native interfaces of the application that it is extending. I
would like to show that such application extensions can have parts authored in other .NET languages like
C#. So I set about rearranging my sample extension to become a multimodule assembly where one
.netmodule was authored in C# and another in MEC++ under VS 2003. And then I realized that I had
no idea how to really do this. My current mixed DLL uses a .def file and has some native .dll
exports. What do I do with them? Do I have to put the exported entry points into the module containing the
manifest (i.e. the assembly dll) ? Or can a native program do dynamic linking directly to a
mixed-mode .netmodule and have it work right?
Can anyone point me at an example that shows how to use create multi-language, multimodule
assemblies where some of the modules use IJW and have native exports?
Bern McCarty
Bentley Systems, Inc.