Need help with windows app functions in C

AI Thread Summary
The discussion focuses on how to display the result of a function in a dialog box within a Windows application. The user initially seeks guidance on using a simple function to show its output. The solution involves converting the function's return value into a string format and utilizing the MessageBox function to display it. Additionally, a resource link is provided for further examples related to Visual C++. The conversation highlights the importance of string conversion and the use of standard Windows API functions for GUI interactions.
VirObitus
Messages
19
Reaction score
0
Hello folks,

Ok, I've been doing windows application tutorials, and I can make a mean dropdown list and dialog box, but I have no idea how to get the windows app to use a function. Say I just want a dialog box to pop up and use the function:

int myFunction ()
{
int i = 1;

return i;
}

to display the value of i in the dialog box. How do I do that, or something similar?
C or C++ versions are both acceptable.
 
Technology news on Phys.org
It depends on the GUI toolkit.
Normally you convert the result into a string and then call something like SetwindowText() for the edit box.

Take a look here for samples http://www.functionx.com/visualc/
 
Right. I ended up converting it to a string and using MessageBox. Problem solved.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top