I'm pretty sure that I'm missing an include, or a reference, or something.
I'm quite new to Visual Studio 2005, so it's probably something like the above.
My problem is that I've got a Class Library project that creates a .dll file.
in the solution explorer I went to the project and did an Add->Class->CLR Windows Form. I ended up with class loggerClass : form, which makes sense.
For the life of me, I don't seem to be able to get this class to call MessageBox.Show("string"); ! In the loggerClass.h header file it's got:
using namespace System::Windows::Forms;
and I declare public function void myShow(String ^ a);
Then in loggerClass.cpp I've got
(in the right namespace)
void loggerClass::myShow(String ^ a)
{
MessageBox.Show(a); // error C2143: syntax error : missing ';' before '.'
System::Windows::Forms::MessageBox.Show(a); // same error
}
I've tried a dozen different ways to get this to work, but no luck at all.
The crazy thing is that if I add a C# class to the project (using the technique at
http://blogs.msdn.com/frankpr/archiv...27/198918.aspx ) I can call MessageBox directly from the C# class, simply as
MessageBox.Show(a);
no complaints at all. And I'm compiling this with the command-line compiler so there aren't any special command-line options at work.