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

Managed C++/CLI

 
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 
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 
Thanks a lot for your comments! I've used them in my code, but the problem with debugging is still not solved.
My start button contains the following code:

simWorker = gcnew BackgroundWorker;
simWorker->WorkerSupportsCancellation = true;
simWorker->WorkerReportsProgress = true;
simWorker->DoWork += gcnew DoWorkEventHandler(this, &uDP2::DPSim::simWorker_DoWork);
simWorker->ProgressChanged += gcnew ProgressChangedEventHandler(this, &uDP2::DPSim::simWorker_ProgressChanged);
simWorker->RunWorkerCompleted += gcnew RunWorkerCompletedEventHandler(this, &uDP2::DPSim::simWorker_RunWorkerCompleted);
butReset->Enabled = false;
butPause->Enabled = true;
butStart->Enabled = false;
simWorker->RunWorkerAsync(model);


When I compile and run the program this works fine, the last line in this code runs the actual model. However, when I step through the code in debug mode the last line seems to be skipped; it passes this line without running the model. I don't have a clue what's going on here, this seems to be very strange to me...

Update:
It seems that the code which updates the data on my Graphical User Interface in each timestep causes the problem. I have an "updateGUI" function which is called in each timestep from the simulation, which is again called by RunWorkerAsync. The updateGUI function contains:
lblTime->Text = Convert::ToString(Math::Round(*model->state->t,2));
txtX->Text = Convert::ToString(Math::Round(model->state->eta[0,0],2));
txtY->Text = Convert::ToString(Math::Round(model->state->eta[1,0],2));
txtPsi->Text = Convert::ToString(Math::Round(model->state->eta[5,0],2));
lblWindDirSim->Text = Convert::ToString(*model->environment->windDir / Math::PI * 180);


If I comment this out the code runs fine in debug mode, otherwise it doesn't. Any idea what the problem could be?

modified on Thursday, June 24, 2010 5:41 AM

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 
AnswerRe: Assembly info not showing up in explorer in managed DLL Pin
Nish Nishant19-Jun-10 7:25
sitebuilderNish Nishant19-Jun-10 7:25 
GeneralRe: Assembly info not showing up in explorer in managed DLL Pin
alleyes20-Jun-10 5:53
professionalalleyes20-Jun-10 5:53 

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.