Need help with windows app functions in C

Click For Summary
SUMMARY

This discussion focuses on implementing functions in Windows applications using C or C++. The user seeks guidance on displaying the return value of a function in a dialog box. The solution involves converting the integer return value into a string format and utilizing the MessageBox function to display it. The discussion also references the SetWindowText function for updating edit box contents.

PREREQUISITES
  • Understanding of C or C++ programming languages
  • Familiarity with Windows API functions
  • Knowledge of GUI toolkits for Windows applications
  • Basic string manipulation techniques in C/C++
NEXT STEPS
  • Explore Windows API MessageBox function for displaying messages
  • Learn about SetWindowText function for updating GUI elements
  • Investigate string conversion techniques in C/C++
  • Review GUI toolkit options for Windows applications, such as Win32 or MFC
USEFUL FOR

Developers working on Windows applications, particularly those looking to integrate functions into their GUI, as well as beginners seeking to understand Windows API 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.
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
14
Views
4K
  • · Replies 15 ·
Replies
15
Views
8K
Replies
19
Views
4K
  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 5 ·
Replies
5
Views
5K
Replies
4
Views
3K
  • · Replies 13 ·
Replies
13
Views
6K