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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:31:37+00:00 2026-05-26T22:31:37+00:00

I’ve created my dialog as a resource using the resource editor (dialog editor?) It’s

  • 0

I’ve created my dialog as a resource using the resource editor (dialog editor?)

It’s nothing special, just two groupboxes, two buttons, a split button, two pictureboxes, 3 static labels, 3 edit boxes, 3 spin controls, 3 syslinks, and a progressbar.

When I press Ctrl+T to test the dialog, it appears to work fine, but when I press F5 to debug the program, the dialog never appears and the program exits with code -1 (0xffffffff)

Here is the code I’m using to call the dialog:

#include <Windows.h>
#include "resource.h"

BOOL CALLBACK DlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
    switch (Msg)
    {
        case (WM_COMMAND):
            switch (LOWORD(wParam))
            {
                default:
                    break;
            }
            break;

        default:
            return FALSE;
    }

    return FALSE;
}

int WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   LPSTR lpCmdLine,
                   int nCmdShow)
{
    int ret = DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAINWINDOW), NULL, DlgProc);

    int err = GetLastErro(); // This gives 0

    return ret; // This gives -1
}

I don’t have anything yet in the DlgProc yet because I just wanted the dialog to show to begin with.

If I set a breakpoint in DlgProc then these are the messages it receives:

48, 85, 297, 273, 273, 144, 2, and 130.

I’ve looked these up and they translate to:

WM_SETFONT
WM_NOTIFYFORMAT
???
WM_COMMAND
WM_COMMAND
???
WM_DESTROY
WM_NCDESTROY

Anybody know what I’m doing wrong?


Edit::
I found a solution to the problem! We originally thought it was a corrupted RC file but I realised the the test RC file I made has every type of control except a SysLink. When I added a SysLink the same thing happened. I tried including ComCtl32.lib in the linker, and I also tried including the common controls header and calling InitCommonControls but that did nothing.

I put everything back the way it originally was, and added this pre-processor directive which fixed it:

#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

That was the problem. Without that directive, the dialog won’t initialise because of the SysLinks!

  • 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-26T22:31:37+00:00Added an answer on May 26, 2026 at 10:31 pm

    You don’t need to call DefWindowProc for Dialog procs. They are done for you by the OS. simply return FALSE;

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I am using Paperclip to handle profile photo uploads in my app. They upload

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.