Hello Bill,
thank you for your help, I received all your files.
I note that your projects has been created with VisualStudio 2002.
I tried your pojects and lib with Visual Studio 2003, and after conversion
they all work.
So, i re-created another project for a C++ class library (.Net), with your
source file that contains the code.
and when i try to generate the dll, i always get the following errors:
libembed.obj : error LNK2001: symbole externe non résolu "void * __cdecl
operator new(unsigned int)" (??2@$$FYAPAXI@Z)
C:\Documents and Settings\Cloup\Mes documents\Projets Visual
Studio\Essais\Cpp\embed\Debug\libembed.dll : fatal error LNK1120: 1 externes
non résolus
Someone can explain, how to correct this?
Pascal
billr said:
Ignore my last post, I found it ... will send shortly
)
Pascal Cloup said:
My code is the same as yours, but don't works. I think that the origin of my
problem is with the linking process. Could you send me you complete projet
so that i could compare with mine.
Thanks in advance
Pascal
billr said:
Okay, I didn't realise you were linking to C#, however that should not make
any difference. For example:
I create a new C# Console Application project called THarness, then using
the solution explorer window I right click on the references folder
for
that
proj. and I select Add Reference..., then I select the project tab and choose
my TestEmbed C++ dll. I then enter the following code in my Class1.cs file
using System;
namespace THarness
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
TestEmbed.Class1 ce = new TestEmbed.Class1();
}
}
}
The output is as expected.
W:\C#\THarness\bin\Debug>tharness
TestEmbed::Class1(void) - entering ...
Executing TestEmbed::CEmbeded::toto
TestEmbed::Class1(void) - leaving ...
Next I create a new C# Windows Application project THarness2, I make my
reference to the C++ TestEmbed.dll (same method as above). Next I add a
button to Form1, and create the event handler thus
private void button1_Click(object sender, System.EventArgs e)
{
TestEmbed.Class1 ce = new TestEmbed.Class1();
}
Then I run the application in the debugger, and the output window contains
the expected output.
TestEmbed::Class1(void) - entering ...
Executing TestEmbed::CEmbeded::toto
TestEmbed::Class1(void) - leaving ...
CAVEAT:
I am using Visual Studio 2002 version 7.0.9466
Microsoft Visual C# .NET 55603-640-5059711-18767
Microsoft Visual C++ .NET 55603-640-5059711-18767