Click here to Skip to main content
15,894,460 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Cdialog CWnd* pParent null after passing this pointer to Cdialog constructer Pin
leon de boer22-Feb-18 21:26
leon de boer22-Feb-18 21:26 
QuestionCOM usage issue Pin
Fedrer21-Feb-18 21:23
Fedrer21-Feb-18 21:23 
AnswerRe: COM usage issue Pin
Richard MacCutchan21-Feb-18 21:28
mveRichard MacCutchan21-Feb-18 21:28 
GeneralRe: COM usage issue Pin
Fedrer21-Feb-18 21:35
Fedrer21-Feb-18 21:35 
GeneralRe: COM usage issue Pin
Richard MacCutchan21-Feb-18 21:56
mveRichard MacCutchan21-Feb-18 21:56 
GeneralRe: COM usage issue Pin
Fedrer21-Feb-18 23:51
Fedrer21-Feb-18 23:51 
GeneralRe: COM usage issue Pin
CPallini22-Feb-18 0:30
mveCPallini22-Feb-18 0:30 
QuestionCleaver macro (string concatenation?) or function to optimize size of array by turning it into a struct/linked list? Pin
arnold_w19-Feb-18 22:16
arnold_w19-Feb-18 22:16 
AnswerRe: Cleaver macro (string concatenation?) or function to optimize size of array by turning it into a struct/linked list? Pin
leon de boer20-Feb-18 7:53
leon de boer20-Feb-18 7:53 
QuestionHow to redirect WriteFile func writes to console Pin
Łukasz Gęsieniec18-Feb-18 19:13
Łukasz Gęsieniec18-Feb-18 19:13 
AnswerRe: How to redirect WriteFile func writes to console Pin
leon de boer18-Feb-18 19:59
leon de boer18-Feb-18 19:59 
GeneralRe: How to redirect WriteFile func writes to console Pin
Łukasz Gęsieniec18-Feb-18 20:10
Łukasz Gęsieniec18-Feb-18 20:10 
GeneralRe: How to redirect WriteFile func writes to console Pin
leon de boer18-Feb-18 21:06
leon de boer18-Feb-18 21:06 
GeneralRe: How to redirect WriteFile func writes to console Pin
leon de boer18-Feb-18 22:45
leon de boer18-Feb-18 22:45 
GeneralRe: How to redirect WriteFile func writes to console Pin
Łukasz Gęsieniec19-Feb-18 0:34
Łukasz Gęsieniec19-Feb-18 0:34 
GeneralRe: How to redirect WriteFile func writes to console Pin
leon de boer19-Feb-18 5:48
leon de boer19-Feb-18 5:48 
GeneralRe: How to redirect WriteFile func writes to console Pin
leon de boer19-Feb-18 6:19
leon de boer19-Feb-18 6:19 
GeneralRe: How to redirect WriteFile func writes to console Pin
Łukasz Gęsieniec19-Feb-18 9:06
Łukasz Gęsieniec19-Feb-18 9:06 
GeneralRe: How to redirect WriteFile func writes to console Pin
Łukasz Gęsieniec19-Feb-18 19:53
Łukasz Gęsieniec19-Feb-18 19:53 
GeneralRe: How to redirect WriteFile func writes to console Pin
leon de boer19-Feb-18 20:14
leon de boer19-Feb-18 20:14 
GeneralRe: How to redirect WriteFile func writes to console Pin
Łukasz Gęsieniec19-Feb-18 22:34
Łukasz Gęsieniec19-Feb-18 22:34 
GeneralRe: How to redirect WriteFile func writes to console Pin
leon de boer20-Feb-18 6:18
leon de boer20-Feb-18 6:18 
Yes because you didn't put it in a worker thread Smile | :)

You need runCommand() to be in a worker thread .. it has to execute in the background so you can keep the WPF framework running in the foreground.

Look back at the windows code I had to do the same thing the CreateProcess(...) is inside a function which is spawned into it's own thread via CreateThread.

Unfortunately I don't use C# enough to know the code for making a worker thread off the top of my head.
I actually don't have the WPF framework installed on my VisualStudio at the moment to work it out.

Basically however we can describe it
1.) everything in runCommand() needs to go inside the worker thread start function .. when the thread starts it runs the app
2.) When the app finishes or your WPF app finishes you need to close the worker thread (LOOK at WM_DESTROY on the windows code)

So basically this worker thread will be chugging along in the background running the app but your program comes back to you to continue on to run the WPF framework.

So you job is to work out how to make a WPF worker thread and incorporate the code Smile | :)
In vino veritas

GeneralRe: How to redirect WriteFile func writes to console Pin
leon de boer20-Feb-18 6:33
leon de boer20-Feb-18 6:33 
GeneralRe: How to redirect WriteFile func writes to console Pin
Łukasz Gęsieniec20-Feb-18 23:32
Łukasz Gęsieniec20-Feb-18 23:32 
GeneralRe: How to redirect WriteFile func writes to console Pin
leon de boer21-Feb-18 7:12
leon de boer21-Feb-18 7:12 

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.