Results 1 to 1 of 1

Thread: Resource Error 0x00000716 (Solved : ))

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    May 2001
    Location
    UK
    Posts
    40

    Talking Resource Error 0x00000716 (Solved : ))

    Subject: Missing resource
    O.S: w2000 pro
    Compiler VC++ 6
    App: Win
    Error msg: The specified resource name cannot be found in the image file.

    Hello

    I'm try to produce a small dialog box app ( part of a tutorial), but for some reason I am receiving the error msg above! What have I missed out?

    It compiles, the resource file is there and dialog box id is correct, but it bombs out when you try to run it !

    Thanks

    hmm

    Code:

    header file


    #ifndef _R_H_INCLUDED
    #define _R_H_INCLUDED

    #define IDD_DIALOG 200

    #endif // _RC_H_INCLUDED

    source file

    #include <iostream>
    #include <windows.h>
    #include "r.h"
    using namespace std;

    HINSTANCE hinstance;


    BOOL CALLBACK DialogProc (HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
    {
    switch(Message)
    {
    case WM_COMMAND:
    switch(LOWORD(wParam))
    {
    case IDOK:
    MessageBox(hwnd, "Hi!", "This is a message",
    MB_OK | MB_ICONEXCLAMATION);
    break;
    case IDCANCEL:
    MessageBox(hwnd, "Bye!", "This is also a message",
    MB_OK | MB_ICONEXCLAMATION);
    break;
    }
    break;
    default:
    return FALSE;
    }
    return TRUE;

    }


    int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){

    hinstance =hInst;
    HWND hDialog;


    hDialog = CreateDialog (hInst,MAKEINTRESOURCE(IDD_DIALOG),0,DialogProc);
    if (!hDialog)
    {
    char buf [100];
    wsprintf (buf, "Error x%x", GetLastError ());
    MessageBox (0, buf, "CreateDialog", MB_ICONEXCLAMATION | MB_OK);
    return 1;
    }
    MSG msg;
    int status;
    while ((status = GetMessage (& msg, 0, 0, 0)) != 0)
    {
    if (status == -1)
    return -1;
    if (!IsDialogMessage (hDialog, & msg))
    {
    TranslateMessage ( & msg );
    DispatchMessage ( & msg );
    }
    }

    return msg.wParam;

    }
    Last edited by hmm; Jan 12th, 2002 at 08:57 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width