Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Need help with windows app functions in C

  1. Jan 14, 2009 #1
    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.
  2. jcsd
  3. Jan 14, 2009 #2


    User Avatar
    Science Advisor
    Homework Helper

    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/
  4. Jan 15, 2009 #3
    Right. I ended up converting it to a string and using MessageBox. Problem solved.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook