Error

  • From: "Fractal Cat" < >
  • To:
  • Subject: Error
  • Date: Tue, 06 Nov 2012 13:04:43 -0500

I'm running Netbeans 7.3 Beta on Windows 7.

The problem lies somewhere in the call to the CreateDialog function.  The 
message given when creating the Dialog is 'the specified resource name cannot 
be found in the image file'.

Here is my resource file contents:


#include <windows.h>
#include <commctrl.h>
#include <commdlg.h>

#define MY_DIALOG 100
#define IDC_STATIC 101

MY_DIALOG DIALOG 30, 44, 352, 118
STYLE DS_FIXEDSYS |DS_SETFONT |WS_POPUP |WS_VISIBLE |WS_SYSMENU 
|WS_THICKFRAME |WS_MAXIMIZEBOX |WS_MINIMIZEBOX |WS_CAPTION 
CAPTION "Dialog"
FONT 8, "Ms Shell Dlg"
BEGIN
CONTROL "Prime-Projects (c) 2012",IDC_STATIC,"STATIC",SS_LEFT |WS_CHILD 
|WS_GROUP |WS_VISIBLE ,20,10,323,91
END

The resource file is compiled with windres.exe and appears to be ok.  The 
resource.o file is linked when building the project.

Here is some main.cpp code:

HWND hDlg = CreateDialog(hInstance,"MY_DIALOG", NULL, attrib_dialog_proc);
    if (hDlg == NULL) {
        puts("Could not create Window");    
        ErrorExit("Error");
        FreeLibrary(hDLL);
        return false;
    }
    else {
        puts("Created window");
    }
and here's the dialog proc:

BOOL CALLBACK attrib_dialog_proc(HWND hWnd, unsigned wMessage, WPARAM wParam, 
LPARAM lParam)
{
    switch (wMessage)
    {
        case MSG_CLICK:
            PlaySound("click.wav",NULL,SND_NODEFAULT | SND_FILENAME | 
SND_ASYNC );
            return TRUE;
            break;
         
        case WM_INITDIALOG:
            return TRUE;

        case WM_COMMAND:
            if (HIWORD(lParam) == BN_CLICKED)
            {
                switch (wParam)
                {
                    default:
                        break;
                }
            }
            break;
        case WM_SYSCOMMAND:
            switch (wParam) 
            {
                case SC_CLOSE:
                    PostQuitMessage(0);
                    return TRUE;
                default:
                    break;
                    
            }
            break;
        default:
            break;
    }
    
    return FALSE;
}






Error

Fractal Cat 11/03/2012

Error

box 11/05/2012

Error

Fractal Cat 11/06/2012

Error

Fractal Cat 11/07/2012

Project Features

About this Project

CND was started in November 2009, is owned by Leonid Lenyashin, and has 130 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close