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. Missing OnInitDialog()

Missing OnInitDialog()

Scheduled Pinned Locked Moved C / C++ / MFC
visual-studiocsharpc++help
5 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.
  • R Offline
    R Offline
    Robert Palma Jr
    wrote on last edited by
    #1

    I am using C/C++, Visual Studio 6.0 I hsve created a Dialog-based app. I have several Dialog boxes each with it's own Class. When I have done this, VS nicely creates an OnInitDialog() function for each Class. Somehow, on the last Dialog Box / Class that I created, the OnInitDialog() function did not show up. Any help on creating an OnInitDialog(0 function would be greatly appreciated :-) Many thanks, Robert

    J N 2 Replies Last reply
    0
    • R Robert Palma Jr

      I am using C/C++, Visual Studio 6.0 I hsve created a Dialog-based app. I have several Dialog boxes each with it's own Class. When I have done this, VS nicely creates an OnInitDialog() function for each Class. Somehow, on the last Dialog Box / Class that I created, the OnInitDialog() function did not show up. Any help on creating an OnInitDialog(0 function would be greatly appreciated :-) Many thanks, Robert

      J Offline
      J Offline
      Jose Lamas Rios
      wrote on last edited by
      #2

      Robert Palma Jr. wrote: Somehow, on the last Dialog Box / Class that I created, the OnInitDialog() function did not show up. Any help on creating an OnInitDialog(0 function would be greatly appreciated How about copying and adapting what you have in the other dialogs? This is what you need: 1. Declare OnInitDialog as a member of your dialog class. Add it in the dialog header file (the .h file). It's something like this:

      virtual BOOL OnInitDialog();

      2. Provide an implementation for YourDialog::OnInitDialog(). Add it to your dialog implementation file (the .cpp file). Something like this:

      BOOL YourDialog::OnInitDialog()
      {
         CDialog::OnInitDialog();
       
         // TODO: Add extra initialization here
       
         return TRUE; // return TRUE unless you set the focus to a control
      }

      That should be enough. -- jlr http://jlamas.blogspot.com/[^]

      R 1 Reply Last reply
      0
      • R Robert Palma Jr

        I am using C/C++, Visual Studio 6.0 I hsve created a Dialog-based app. I have several Dialog boxes each with it's own Class. When I have done this, VS nicely creates an OnInitDialog() function for each Class. Somehow, on the last Dialog Box / Class that I created, the OnInitDialog() function did not show up. Any help on creating an OnInitDialog(0 function would be greatly appreciated :-) Many thanks, Robert

        N Offline
        N Offline
        Neelesh K J Jain
        wrote on last edited by
        #3

        More comfortably, use Class wizard and then select the class you created then add windows message WM_INITDIALOG. This will add the OnInitDialog() function in your class. Work hard and a bit of luck is KEY to SUCCESS.

        R 1 Reply Last reply
        0
        • J Jose Lamas Rios

          Robert Palma Jr. wrote: Somehow, on the last Dialog Box / Class that I created, the OnInitDialog() function did not show up. Any help on creating an OnInitDialog(0 function would be greatly appreciated How about copying and adapting what you have in the other dialogs? This is what you need: 1. Declare OnInitDialog as a member of your dialog class. Add it in the dialog header file (the .h file). It's something like this:

          virtual BOOL OnInitDialog();

          2. Provide an implementation for YourDialog::OnInitDialog(). Add it to your dialog implementation file (the .cpp file). Something like this:

          BOOL YourDialog::OnInitDialog()
          {
             CDialog::OnInitDialog();
           
             // TODO: Add extra initialization here
           
             return TRUE; // return TRUE unless you set the focus to a control
          }

          That should be enough. -- jlr http://jlamas.blogspot.com/[^]

          R Offline
          R Offline
          Robert Palma Jr
          wrote on last edited by
          #4

          Many thanks Jose :-)

          1 Reply Last reply
          0
          • N Neelesh K J Jain

            More comfortably, use Class wizard and then select the class you created then add windows message WM_INITDIALOG. This will add the OnInitDialog() function in your class. Work hard and a bit of luck is KEY to SUCCESS.

            R Offline
            R Offline
            Robert Palma Jr
            wrote on last edited by
            #5

            Many thanks Neelesh :-)

            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