0 Replies - 1974 Views - Last Post: 01 December 2011 - 02:11 AM

#1 ahura_24  Icon User is offline

  • D.I.C Head

Reputation: -7
  • View blog
  • Posts: 69
  • Joined: 07-March 10

CLI Thread problem

Posted 01 December 2011 - 02:11 AM

hi guys.i have problem with thread in clr i have one thread in class Form1 like:
while ( true )
{
	CPM^ _oPM    = gcnew CPM(); // the class inherit from System::Windows::Forms::Form

	_oPM->ShowWindow(this);
}



in class CPM :

private: delegate System::Void ShowWindowDlg(System::Windows::Forms::IWin32Window^);

public: System::Void ShowWindow(System::Windows::Forms::IWin32Window^ owner)
{
	if ( this->InvokeRequired )
	{
		ShowWindowDlg ^dl = gcnew ShowWindowDlg(this, &CPM::ShowWindow);
		this->Invoke(dl, gcnew array<System::Object^>{ owner });
	}
	else
		this->Show( owner );
}



But break at the run time :((( please help me when call _oPM->ShowWindow(this) programm is broke.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1