#pragma once #using<mscorlib.dll> #using<system.windows.forms.dll> using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Diagnostics; using namespace System::Windows::Forms; namespace ShashiTest { public delegate void ShowResult(System::String^); public ref class test { public: event ShowResult^ OnShowResult; test(void) { }; void ShowMessage() { MessageBox::Show("Hello World"); } }; class ManagedInterface { public: gcroot<test^> m_test; ManagedInterface(){}; ~ManagedInterface(){}; void ResultWindowUpdate(std::string ResultString); }; } void ShashiTest::ManagedInterface::ResultWindowUpdate(std::string ResultString) { if(m_test) { System::String ^result = gcnew system::String(ResultString.c_str()); m_test->OnShowResult(result); } }</system.windows.forms.dll></mscorlib.dll>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)