I've always programmed in C++ in console mode so I don't know very much about VC++,
the point is that I'm trying to export my C++ console application to a Windows form (VC++) in order to have a GUI.
The problem is that i don't know how to import my application in the windows form, I've spent some days searching info on the Internet but I haven't been able to solve my problem.
The only information I've found is that i should create a class for my console application and
call this class in the windows form, but i don't know how to call the class in the windows form and also i'm not sure if I should do it in that way (maybe I should create a .dll?)
your program seems to be working fine in console mode now. Noting wrong with that.
If all your GUI application ends up doing is just simulating a console type program you've just succedded in doing a lot of work to get a gob of extra code size that achieves essentially nothing.
i'm not saying making a GUI program is necessarily a bad thing, if you havea lot of input, or could benefit from feaures like built in configuration dialogs instead of using commandline parameters etc... then maybe, but turning a console program into a fully functional takes more than just wrapping all the code into a GUI.
For one, a Console program is always responsive, this isn't the case for GUI, you'll likely need to create a worker thread for the work, and have your GUI thread respond to and submit work to that worker thread. Stuff like this can very easily turn a 100lines of console program into several thousand lines of GUI program for very little (if any) actual benefit.
@olivthill2: thanks for the help, but I don't want to execute the .exe file, i want to access to the functions and modify some variables for my console project, but using a GUI. I hope I'm explaining well :S
@OReubens & @Skizmo: I know that there will be a lot of more work to do if I do it in windows form, but the main idea is this (I think I didn't explain it very well):
- I have the console project with the functions, variables and all this stuff, so what I would like to do is exporting this to a Windows form, for example: - show the results in the windows form, - use some functions from the console app, - be able to have access to different variables in the windows form... and this stuff.
That's why I thought that I should create a class for my console project, and call the functions and all the things I explained before, in the Windows form.
The problem is that i don't know if a class is what I should do and if so, how I have to do it.