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.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Back
Top