Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 227225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:34:50+00:00 2026-05-11T19:34:50+00:00

This is my first MFC application away from VC6, and I feel a little

  • 0

This is my first MFC application away from VC6, and I feel a little bit stupid:

How do I add the OnInitDialog handler?
(I know how to add it manually, but that’s a pain in the long run).

double-clicking the dialog – nothing.
right click the dialog – “add event handler” is disabled.
Properties – Messages has “normal” messages, but not WM_INITDIALOG
Properties – Events only holds notifications from contained controls
right-clicking in class view – “Add..” only has functions and variables

scratches head

[edit] d’oh – it’s a virtual function in MFC, but still…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:34:50+00:00Added an answer on May 11, 2026 at 7:34 pm

    Don’t feel stupid, it took me forever to figure this out when I first moved from VC6 to VS2008!

    Anyway, and also for my own reference, here are the complete steps for adding a dialog box and overriding the OnInitDialog method:

    1. Select Resource View and expand the .rc file.
    2. Right-click the Dialog entry in the tree view and select Insert Dialog.
    3. Select the Properties window. (Note: If you don’t see this window, select the View > Other Windows > Properties Window menu item.)
    4. In the Properties window, set the ID for the dialog, e.g., IDD_MYDIALOG.
    5. Right click the dialog in the resource editor and select Add Class. Note: if you have IE8 installed, this may produce an Internet Explorer Script Error. See this blog post for details on how to correct this.
    6. In the MFC Class Wizard dialog box, enter the class name, e.g., CMyDialog, select CDialog as the base class, then press Finish. This will create files named MyDialog.cpp and MyDialog.h and add them to your project.

    To override the OnInitDialog method in the CMyDialog class:

    1. Open the file MyDialog.h.
    2. Select the Properties window.
    3. Place the cursor on the line that reads class CMyDialog : public CDialog. (The top of the Properties window should show “CMyDialog VCCodeClass” – this is important, because the Properties window is highly context sensitive, and you get different options depending on the location of the cursor in the editor.)
    4. Click the Overrides icon in the Properties window.
    5. Scroll down the properties window to find OnInitDialog.
    6. Click the down arrow against this entry and select <Add> OnInitDialog. This should create your CMyDialog::OnInitDialog function.

    I hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first my MFC application, and unfortunately i don't understand, how it
This first bit works: $my_id = 617; $post_id_7 = get_post($my_id); $title = $post_id_7->post_excerpt; echo
Code first: '''this is main structure of my program''' from twisted.web import http from
First, I know this is kind of common question, but I could not find
I'm getting some strange behaviour from EF Code First when I add an object
$(this):first-child is the wrong syntax I didn't know how to use first-child with $(this)
i have two arrays like this first array Array ( [0228] => Array (
Using Dozer to map two objects, I have: /** /* This first class uses
#include <iostream> using namespace std; // This first class contains a vector and a
this my first shot at this awesome new (to me) programmers site, I hope

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.