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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Help with modeless dialog error

Help with modeless dialog error

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
4 Posts 3 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.
  • K Offline
    K Offline
    Kwanalouie
    wrote on last edited by
    #1

    Using Visual C++ 6.0 MFC in SDI application I created a dialog box class called CTestDialog and assocatied files TestDialog.cpp and TestDialog.h. The dialog box ID is IDD_TESTDIALOGBOX. I want to have it run as a modeless dialog, and I have a routine in MainFrm.cpp where I want to control the display of this dialog box. When I put the header file for test dialog into MainFrm.cpp I get a compilation error. #include "TestDialog.h" error C2065: 'IDD_TESTDIALOGBOX' : undeclared identifier I don't get this error when the header file is placed in any other .cpp file. I don't understand what the problem is. Thanks

    J G 2 Replies Last reply
    0
    • K Kwanalouie

      Using Visual C++ 6.0 MFC in SDI application I created a dialog box class called CTestDialog and assocatied files TestDialog.cpp and TestDialog.h. The dialog box ID is IDD_TESTDIALOGBOX. I want to have it run as a modeless dialog, and I have a routine in MainFrm.cpp where I want to control the display of this dialog box. When I put the header file for test dialog into MainFrm.cpp I get a compilation error. #include "TestDialog.h" error C2065: 'IDD_TESTDIALOGBOX' : undeclared identifier I don't get this error when the header file is placed in any other .cpp file. I don't understand what the problem is. Thanks

      J Offline
      J Offline
      Jijo Raj
      wrote on last edited by
      #2

      The dialog IDs are defined in resource.h So add #include "resource.h" in your corresponding cpp file which shows the error. Regards, Jijo.

      _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

      K 1 Reply Last reply
      0
      • J Jijo Raj

        The dialog IDs are defined in resource.h So add #include "resource.h" in your corresponding cpp file which shows the error. Regards, Jijo.

        _____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.

        K Offline
        K Offline
        Kwanalouie
        wrote on last edited by
        #3

        thanks!

        1 Reply Last reply
        0
        • K Kwanalouie

          Using Visual C++ 6.0 MFC in SDI application I created a dialog box class called CTestDialog and assocatied files TestDialog.cpp and TestDialog.h. The dialog box ID is IDD_TESTDIALOGBOX. I want to have it run as a modeless dialog, and I have a routine in MainFrm.cpp where I want to control the display of this dialog box. When I put the header file for test dialog into MainFrm.cpp I get a compilation error. #include "TestDialog.h" error C2065: 'IDD_TESTDIALOGBOX' : undeclared identifier I don't get this error when the header file is placed in any other .cpp file. I don't understand what the problem is. Thanks

          G Offline
          G Offline
          Gary R Wheeler
          wrote on last edited by
          #4

          You can also edit TestDialog.h and put

          #include "resource.h"

          at the top, before your CTestDialog declaration.

          Software Zen: delete this;
          Fold With Us![^]

          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