C++/CLI - Change checkbox checked state from other file

  • Thread starter Thread starter alexSimpler
  • Start date Start date
A

alexSimpler

Guest
So I have a myForm.h file which contains my main application UI and this app has a checkbox that if checked opens a console using AllocConsole and then I have another file which implements functionality to the console and then tries to change the checkbox state of my form when it finished its part.

myForm.h


private: System::Void checkBox3_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {
if (this->checkBox3->Checked == true)
{
AllocConsole();
freopen("CONOUT$", "w", stdout);//use cout

other::start();

}
}


Function in other file which has to change the checkbox state:


void start() {

if (g.debug) {
system("pause");

/ //close and free console
PostMessageA(GetConsoleWindow(), WM_SYSCOMMAND, SC_CLOSE, 0);
FreeConsole();
//change the checkbox checked property to false
}

}




I can't figure out how to achieve what I want, I tried alot of methods but all of them did not work and were affecting performance, any idea?

Thanks in advance.

Continue reading...
 
Back
Top