Click here to Skip to main content
15,915,328 members

Comments by Divyanthj123 (Top 5 by date)

Divyanthj123 3-Sep-11 8:34am View    
You mean like a separate file? That's a good idea perhaps I can make the forms application save data to a file and start the console application as a process...the console application can fetch data from the file to execute.
Divyanthj123 3-Sep-11 1:05am View    
I appreciate your elaborate reply. I think the last one was close to what I am looking for. Sorry I am not familiar with the windows API or even visual c++ for that matter, so there's little that I am able to follow. So how about a walkthrough for specifically designing the following app:-

Form1:-
-Two textboxes, one accepts the value of integer "x" and the other accepts integer "y"
-One submit button. The submit button starts the following console program.

//addition.cpp
#include<iostream.h> //or stdio.h
int x;
int y;

int main()
{
int sum;
sum=x+y;
cout << sum; // or printf("%d", sum);
}


I just need to know the following:-
-How to change global variables of addition.cpp from another form so that it can perform its internal operations.
>> I am aware of this because the global variables of one console application can be changed from another console application when they are linked together using #include.

-How to run the console program after the window encounters an event (button_click for example).


Another idea(just throwing it out there):

I am attempting to fetch the values of global variables from an external text file using file structure concepts.
Divyanthj123 2-Sep-11 11:42am View    
In the example program I gave, how about changing the name of the main function to "int addition()", then call the addition() function from the addition.cpp?

Is that possible?
Divyanthj123 2-Sep-11 11:38am View    
You need to use directx for having graphics on a windows gui, which is the reason why I am not porting the console to a window. I am using Allegro libraries, and the best I can do is run the physics simulator on a smaller windowed mode.

All I want out of this app, is to allow the user enter some values so that it uses them in the console application. Previously, the parameters in my console app were initialized at the start of the program. Now, I want the user to set those values.
Divyanthj123 2-Sep-11 7:38am View    
Too generic, and does the opposite of what I want.
I want the form to generate a console, not vice-versa.