On Jul 2, 9:02 am, "William DePalo [MVP VC++]"
<willd.no.s...@mvps.orgwrote:
"jraul" <jrauli...@yahoo.comwrote in message
news:11**********************@d30g2000prg.googlegr oups.com...
I was looking in my class library's debug folder instead of the
solution's debug folder. Okay, so I added a reference to the DLL but
the following code doesn't work. I get the error in the C# project:
error CS0117: 'UnmanagedBackEnd.Test' does not contain a definition
for 'foobar'
As you have shown it, the function is not visible not publicly.
Regards,
Will
Doh :)
Thanks for the help so far. Okay, now both the class library (C++/
CLI) and C# project compile and link, but when I execute I get the
error:
An unhandled exception of type 'System.BadImageFormatException'
occurred in Forms Test.exe
Additional information: Could not load file or assembly 'Unmanaged
BackEnd, Version=1.0.2739.15785, Culture=neutral, PublicKeyToken=null'
or one of its dependencies. An attempt was made to load a program with
an incorrect format.
I'm not sure what's wrong with the DLL. I tried deleting the
reference, and adding a new reference to the latest class library
build. The code is basically the same as above except I made the
methods of Test public:
public ref class Test
{
public:
Test()
{
}
void foobar()
{
System::Console::WriteLine("Hello");
}
};
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Test test = new Test();
test.foobar();
}
}