Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Procedure/Function question

Procedure/Function question

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestiontutoriallearning
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Richard Cheng
    wrote on last edited by
    #1

    I'm using MFC programming to implement a software. Of course there are "View, Doc, mainframe...etc" file..... I've added a dialog box with a textbox for me to input some values. And I have separate file called ABC.cpp to do other things. In the ABC.cpp, I would like to pop up that dialog box to let user to input the value and then use that value in ABC.cpp. However, i got the following error message: C:\XYZ\InputNum.h(21) : error C2065: 'IDD_INPUTNUM' : undeclared identifier C:\XYZ\InputNum.h(21) : error C2057: expected constant expression I did everything already: CInputNum InputNum; InputNum.DoModal(); num = InputNum.m_inputnumber; Do you know why? and how to fix it? I don't want to make a global variable......

    T 1 Reply Last reply
    0
    • R Richard Cheng

      I'm using MFC programming to implement a software. Of course there are "View, Doc, mainframe...etc" file..... I've added a dialog box with a textbox for me to input some values. And I have separate file called ABC.cpp to do other things. In the ABC.cpp, I would like to pop up that dialog box to let user to input the value and then use that value in ABC.cpp. However, i got the following error message: C:\XYZ\InputNum.h(21) : error C2065: 'IDD_INPUTNUM' : undeclared identifier C:\XYZ\InputNum.h(21) : error C2057: expected constant expression I did everything already: CInputNum InputNum; InputNum.DoModal(); num = InputNum.m_inputnumber; Do you know why? and how to fix it? I don't want to make a global variable......

      T Offline
      T Offline
      Tim Deveaux
      wrote on last edited by
      #2

      Looks like you are including inputnum.h without including resource.h for that translation unit. Its nicer if you can keep #includes out of header files, but including resource.h inside inputnum.h would probably solve the problem.

      R 1 Reply Last reply
      0
      • T Tim Deveaux

        Looks like you are including inputnum.h without including resource.h for that translation unit. Its nicer if you can keep #includes out of header files, but including resource.h inside inputnum.h would probably solve the problem.

        R Offline
        R Offline
        Richard Cheng
        wrote on last edited by
        #3

        Wow........you are superb!!! Thanks.... It works!!!!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups