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 430945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:55:32+00:00 2026-05-12T19:55:32+00:00

A dialog I’m working on isn’t displaying, using: CWnd::CreateDlgIndirect(LPCDLGTEMPLATE lpDialogTemplate,CWnd* pParentWnd, HINSTANCE hInst) The

  • 0

A dialog I’m working on isn’t displaying, using:

CWnd::CreateDlgIndirect(LPCDLGTEMPLATE lpDialogTemplate,CWnd* pParentWnd, HINSTANCE hInst)

The call to CreateDlgIndirect is in a lon-used base-class, which effectively takes the IDD of the dialog template in the resource file – it works fine for many other dialogs but I can’t see what’s different in my dialog. My dialog works fine when created in a more normal way, but I have to use the base class as it has loads of other functionality built in.

What I find when trawling through CWnd::CreateDlgIndirect in dlgcore.cpp, is that the plain Win32 API call is failing:

hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate,pParentWnd->GetSafeHwnd(), AfxDlgProc);

I can’t step into that function for some reason, so all I see is the HWND is NULL.

Can anyone suggest what kind of problems might be causing this? I compared the two dialog resource templates and their properties are the same.

edit: I have one custom control on the dialog. When I remove this, it works. No idea why, what difference might this make?

  • 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-12T19:55:32+00:00Added an answer on May 12, 2026 at 7:55 pm

    One of the more obscure ways for CreateDialogXXX to fail is for a child control on the dialog to fail creation. Usually because the application has not initialized the common controls library before attempting to effect the dialog creation. See InitCommonControlsEx

    One way to check this is to open the dialog in the resource editor, go to the dialog’s properties, and find and turn on the DS_NOFAILCREATE flag. Usually called something obscure like “No Fail Create”. Or add the DS_NOFAILCREATE directly to your dialog template in memory. This will allow the dialog to show, and the culprit should be evident by its absence.

    In the case that the child control is an actual custom control – well the custom window class is either not registered correctly, or at all. Check the HINSTANCE used in registration – unless the CS_GLOBAL flag is specified, window classes are identified by (hInstance, ClassName) – this prevents window classes using the same name in different dlls conflicting.

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

Sidebar

Related Questions

Using of mobile dialog authentication is working well for other mobile devices except on
Using jQuery's dialog I came across the following quirk (tested in FF3): User selects
So I got a dialog box that is loaded dynamically using AJAX, in that
I'm using this dialog: $(#myDialog).dialog({ hide: {effect: fade, duration: 3000}, buttons: { Save: function()
am using a Dialog with a custom view. That view's layout is 300dp x
After creating a custom Dialog using a ListView and my own implementation of ListAdapter
The new enhanced auth dialog also shows which of your friends are also using
I have a dialog box. When I call a show on it, everything in
I am using Progress Dialog box.By default it open on full screen so can
I am initialising a Dialog by using OnInitDialog and i initialized a static text

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.