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

    mgb_phys

    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Need help with windows app functions in C
  1. C++ void function help (Replies: 3)

  2. Need C++ getline() Help (Replies: 17)

  3. Need help about c++ (Replies: 3)

Loading...