Click here to Skip to main content
15,920,111 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Custom combo Bo [modified] Pin
Andreoli Carlo24-Jun-10 22:32
professionalAndreoli Carlo24-Jun-10 22:32 
QuestionHow to stop a simulation while running Pin
KlaasVersteeg21-Jun-10 22:27
KlaasVersteeg21-Jun-10 22:27 
AnswerRe: How to stop a simulation while running Pin
Luc Pattyn22-Jun-10 1:21
sitebuilderLuc Pattyn22-Jun-10 1:21 
GeneralRe: How to stop a simulation while running Pin
KlaasVersteeg22-Jun-10 5:31
KlaasVersteeg22-Jun-10 5:31 
GeneralRe: How to stop a simulation while running Pin
Luc Pattyn22-Jun-10 6:07
sitebuilderLuc Pattyn22-Jun-10 6:07 
GeneralRe: How to stop a simulation while running Pin
KlaasVersteeg22-Jun-10 20:38
KlaasVersteeg22-Jun-10 20:38 
AnswerRe: How to stop a simulation while running Pin
Luc Pattyn23-Jun-10 2:22
sitebuilderLuc Pattyn23-Jun-10 2:22 
GeneralRe: How to stop a simulation while running Pin
KlaasVersteeg23-Jun-10 2:42
KlaasVersteeg23-Jun-10 2:42 
That makes sense... Here is the relevant part of my code.

I made a BackgroundWorker called simWorker, and a start and stop button which should, obviously, start and stop my simulation. Starting it works fine when I compile the code, but nothing happens when I run in debug mode. The stop button is not working yet, I'm still finding out how to deal with that.
Hope you can think of something to make this also run in debug mode, that would make life much easier.

Thanks!


namespace uDP2 {
	public ref class DPSim : public System::Windows::Forms::Form
	{
	static clModel^ model = gcnew clModel;
	public:
		DPSim(clModel^ mdl)
		{
			InitializeComponent();
			model = mdl;
			InitializeSimWorker();
		}

	protected:
		~DPSim()
		{
			if (components)
			{
				delete components;
			}
		}

	private: System::ComponentModel::IContainer^  components;
	protected: 

	private:
		System::ComponentModel::BackgroundWorker^ simWorker;
		void InitializeSimWorker(){
			simWorker = gcnew BackgroundWorker;
			simWorker->DoWork += gcnew DoWorkEventHandler( this, &DPSim::simWorker_DoWork );
		}
		void simWorker_DoWork( Object^ sender, DoWorkEventArgs^ e ){
			BackgroundWorker^ worker = dynamic_cast<BackgroundWorker^>(sender);
			e->Result = simulate(model, worker, e);
		}

#pragma region Windows Form Designer generated code
{
        // code to generate form and components
}
#pragma endregion
	private: clModel^ simulate(clModel^ model, BackgroundWorker^ worker, DoWorkEventArgs^ e){
		// run simulation
		return model;
	}
	private: System::Void butStart_Click(System::Object^  sender, System::EventArgs^  e) {
		simWorker->RunWorkerAsync(model);
	}
	private: System::Void butStop_Click(System::Object^  sender, System::EventArgs^  e) {
		model->state->modelRunning = Convert::ToInt32(0);
	}
};
}

AnswerRe: How to stop a simulation while running Pin
Luc Pattyn23-Jun-10 3:14
sitebuilderLuc Pattyn23-Jun-10 3:14 
GeneralRe: How to stop a simulation while running [modified] Pin
KlaasVersteeg23-Jun-10 21:08
KlaasVersteeg23-Jun-10 21:08 
GeneralRe: How to stop a simulation while running Pin
Luc Pattyn24-Jun-10 2:48
sitebuilderLuc Pattyn24-Jun-10 2:48 
GeneralRe: How to stop a simulation while running Pin
KlaasVersteeg24-Jun-10 3:04
KlaasVersteeg24-Jun-10 3:04 
GeneralRe: How to stop a simulation while running Pin
Luc Pattyn24-Jun-10 3:38
sitebuilderLuc Pattyn24-Jun-10 3:38 
GeneralRe: How to stop a simulation while running Pin
KlaasVersteeg24-Jun-10 3:49
KlaasVersteeg24-Jun-10 3:49 
Questionproblem with BOOST threads with mixed mode C++/CLI and Visual Studio 2010 [modified] Pin
T210221-Jun-10 18:38
T210221-Jun-10 18:38 
AnswerRe: problem with BOOST threads with mixed mode C++/CLI and Visual Studio 2010 Pin
Paul Michalik20-Aug-10 23:14
Paul Michalik20-Aug-10 23:14 
GeneralRe: problem with BOOST threads with mixed mode C++/CLI and Visual Studio 2010 Pin
T210220-Aug-10 23:22
T210220-Aug-10 23:22 
GeneralRe: problem with BOOST threads with mixed mode C++/CLI and Visual Studio 2010 [modified] Pin
Paul Michalik21-Aug-10 23:40
Paul Michalik21-Aug-10 23:40 
GeneralRe: problem with BOOST threads with mixed mode C++/CLI and Visual Studio 2010 Pin
T210222-Aug-10 1:27
T210222-Aug-10 1:27 
GeneralRe: problem with BOOST threads with mixed mode C++/CLI and Visual Studio 2010 Pin
Paul Michalik22-Aug-10 21:46
Paul Michalik22-Aug-10 21:46 
GeneralRe: problem with BOOST threads with mixed mode C++/CLI and Visual Studio 2010 Pin
T210223-Aug-10 3:38
T210223-Aug-10 3:38 
QuestionUnraveling the Mysteries of Writing a Winsock 2 Layered Service Provider Pin
Pascal Ganaye21-Jun-10 12:16
Pascal Ganaye21-Jun-10 12:16 
AnswerRe: Unraveling the Mysteries of Writing a Winsock 2 Layered Service Provider Pin
Pascal Ganaye22-Jun-10 14:26
Pascal Ganaye22-Jun-10 14:26 
GeneralRe: Unraveling the Mysteries of Writing a Winsock 2 Layered Service Provider Pin
Richard Andrew x6422-Jun-10 14:32
professionalRichard Andrew x6422-Jun-10 14:32 
QuestionAssembly info not showing up in explorer in managed DLL Pin
alleyes16-Jun-10 9:01
professionalalleyes16-Jun-10 9:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.