User interface for console app

Hi guys,

I have been working on converting my console application to windows application to implement userinterface. I have two questions based on two situation I came across doing the same. My aim is to add a decent UI on top of my console app in order to set various parameters at the beginning.

Sitiuation 1:

Followed by a well documented tutorial. Initially I changed subsystem settings from 'CONSOLE' to 'WINDOWS' , then I added a windows form to my project and modified my main as follows inorder to execute windows form in a STAThread

int main(array<System::String ^> ^args).


But I could not able to compile. Then I reverted back my subsystem setting from 'WINDOWS' to 'CONSOLE' . Now my app is running , I can see the UI on top of the console. But I'm not yet implemented any controls with UI.
I'm wondering if I did something wrong logically!!??

Situation 2:

Now I need to add various controls with my UI form. I tried adding a text box, two buttons and one numeric up down etc.

text box is to enter the name of file to be saved.
numeric updown is to set value to a parameter
buttons are for execution and for closing the app.

My question is , when I double click on these items , a protected function is created on the header but I can not access members which are used in my main function!.

I'm a beginner, sorry about my poor explanation!
Greatly appreciated if someone could please help me out.
Thank you
Last edited on
For the first one, you must missed some steps like settings the runtime or something.

For the second one, you can't access members in main() directly. As you've started using a graphics user interface, you can't just keep the straight forward flow in main(). You need to break the whole logic into small pieces of functions, and then access the functions in the generated protected function.
Topic archived. No new replies allowed.