S
slooper
I am trying to instantiate a Windows Form that I have created in C#.
The problem is that I am instantiating it within a C++ .dll. Here's my
example of what works and what doesn't:
WORKS:
///////////////////////////////////// START CODE
///////////////////////////////
#using <mscorlib.dll>
#using <System.dll>
#using <System.Drawing.dll>
#using <System.Windows.Forms.dll>
using namespace System::Windows::Forms;
PLUGINCALLBACK CStatus TestForm_Execute( CRef& in_ctxt )
{
Context ctxt( in_ctxt );
CValueArray args = ctxt.GetAttribute(L"Arguments");
System::Windows::Forms::Form f;
f.ShowDialog();
f.Close();
return CStatus::OK;
}
///////////////////////////////////// END CODE
///////////////////////////////
DOES NOT WORK:
///////////////////////////////////// START CODE
///////////////////////////////
#using <mscorlib.dll>
#using <System.dll>
#using <System.Drawing.dll>
#using <System.Windows.Forms.dll>
#using <C:\Working Folder\tmp\TestCOM\TestCOM\bin\Release\TestCOM.dll>
using namespace System::Windows::Forms;
using namespace TestCOM;
PLUGINCALLBACK CStatus TestForm_Execute( CRef& in_ctxt )
{
Context ctxt( in_ctxt );
CValueArray args = ctxt.GetAttribute(L"Arguments");
TestCOM::TestForm f;
f.ShowDialog();
f.Close();
return CStatus::OK;
}
///////////////////////////////////// END CODE
///////////////////////////////
I am guessing that I am not compiling the C# .dll properly or that
there is an interface missing in the TestCOM.dll that exists in the
System.Windows.Forms.dll. Are there any compiler settings that would
prevent my C# library from being used within C++?
Any suggestions are appreciated. I've been banging my a head on this
for a week now.
Sean
The problem is that I am instantiating it within a C++ .dll. Here's my
example of what works and what doesn't:
WORKS:
///////////////////////////////////// START CODE
///////////////////////////////
#using <mscorlib.dll>
#using <System.dll>
#using <System.Drawing.dll>
#using <System.Windows.Forms.dll>
using namespace System::Windows::Forms;
PLUGINCALLBACK CStatus TestForm_Execute( CRef& in_ctxt )
{
Context ctxt( in_ctxt );
CValueArray args = ctxt.GetAttribute(L"Arguments");
System::Windows::Forms::Form f;
f.ShowDialog();
f.Close();
return CStatus::OK;
}
///////////////////////////////////// END CODE
///////////////////////////////
DOES NOT WORK:
///////////////////////////////////// START CODE
///////////////////////////////
#using <mscorlib.dll>
#using <System.dll>
#using <System.Drawing.dll>
#using <System.Windows.Forms.dll>
#using <C:\Working Folder\tmp\TestCOM\TestCOM\bin\Release\TestCOM.dll>
using namespace System::Windows::Forms;
using namespace TestCOM;
PLUGINCALLBACK CStatus TestForm_Execute( CRef& in_ctxt )
{
Context ctxt( in_ctxt );
CValueArray args = ctxt.GetAttribute(L"Arguments");
TestCOM::TestForm f;
f.ShowDialog();
f.Close();
return CStatus::OK;
}
///////////////////////////////////// END CODE
///////////////////////////////
I am guessing that I am not compiling the C# .dll properly or that
there is an interface missing in the TestCOM.dll that exists in the
System.Windows.Forms.dll. Are there any compiler settings that would
prevent my C# library from being used within C++?
Any suggestions are appreciated. I've been banging my a head on this
for a week now.
Sean