Using Managed C++ DLL in a J# project

  • Thread starter =?ISO-8859-1?Q?St=E9phane_Postollec?=
  • Start date
?

=?ISO-8859-1?Q?St=E9phane_Postollec?=

Hi,

First i will explain the architecture of my program.

I use an old program which is composed of several modules in Native C++.
All of these modules provides a DLL in Native C++.
We can call them :

DLLModuleNativeC++_XX

Next i want to use these DLL in another Module (a kind of wrapper for
the J# module). And this new module is a Managed C++ module in which i
use the objects provided by the different DLLModuleNativeC++_XX modules.
This module provide a Managed Mixed DLL (an assembly in fact) which will
be used by the main program in J#

We can call it :

DLLModuleManagedMixedC++

Then in my J# program I create an instance of the object
DLLModuleManagedMixedC++ and I call its functions.

My problem is that it doesn't work. So i would like to know if it
possible to do what i've done and if it the case how to make it work.

The problems encountered during the compîlation are only warning but the
problem will become from these warning

Génération de code en cours...
Compilation des ressources en cours...
Édition des liens en cours...
msvcrtd.lib(checkclr.obj) : warning LNK4210: la section .CRT existe ; il
se peut qu'il y ait des terminateurs ou des initialiseurs static non gérés
msvcrtd.lib(secchk.obj) : warning LNK4210: la section .CRT existe ; il
se peut qu'il y ait des terminateurs ou des initialiseurs static non gérés
libcpmtd.lib(xlock.obj) : warning LNK4210: la section .CRT existe ; il
se peut qu'il y ait des terminateurs ou des initialiseurs static non gérés
libcpmtd.lib(cout.obj) : warning LNK4210: la section .CRT existe ; il se
peut qu'il y ait des terminateurs ou des initialiseurs static non gérés
libcpmtd.lib(iosptrs.obj) : warning LNK4210: la section .CRT existe ; il
se peut qu'il y ait des terminateurs ou des initialiseurs static non gérés
libcpmtd.lib(locale0.obj) : warning LNK4210: la section .CRT existe ; il
se peut qu'il y ait des terminateurs ou des initialiseurs static non gérés

In english : warning LNK4210: .CRT section exists; there may be
unhandled static initializers or terminators

Moreover the method which create the instance of
DLLModuleManagedMixedC++ in my J# program is a static method so i think
the problem becomes from theses warning.


But it's only warning and when i lauched my program, it crashs.

The error during the execution (when i want to enter in the function who
create an instance of DLLModuleManagedMixedC++ is :

An exeception of type 'System.IO.FileNotFoundException' is done in the
MAIN.ex (program J#)
The file or the assembly named DLLModuleManagedMixedC++ or one of its
dependances are not found.

Thus i'm asking if my DLLModuleManagedMixedC++ works fine and have
included all the dll provides by all the DLLModuleNativeC++_XX.


To resume i would like to know if i can use DLL in native C++ in a
module with mixed Native and Managed C++ which provides a Managed DLL
that i can use directly in my J# program (i can see the object
DLLModuleManagedMixedC++ and create an new one : i have done a namespace)


So thanks in advance and i hope you will find a solution to my problem
because i run out of idea !!

Steph
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top