Resouce Problem

This is a discussion on Resouce Problem within the Windows Programming forums, part of the Platform Specific Boards category; I was writing my first windows program (as a WIN32 Console Application) , trying out this tutorial http://sunlightd.virtualave.net/Wind...logBoxes.html; . It ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    42

    Resouce Problem

    I was writing my first windows program (as a WIN32 Console Application) , trying out this tutorial http://sunlightd.virtualave.net/Wind...logBoxes.html;. It says that I include a Resource file as a .h file. Could someone please tell me how the resouce editor in Visual C++ 6.0 works ?? Or a suitable tutorial to it.
    Anyway, I used a Resource file generated via the MFC Application Wizard, but that doesn't seem to work. Do I need to include a Resouce template (.rct) or .h or .rc file ???

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    42

    Here's some more info abt the problem

    I used a .rc file, and with the following code,
    Code:
    #include <windows.h>
    #include "d:\Rscript.rc"
    
    bool MainDialogProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
    {
    	return false;
    }
    
    int main()
    {
    	DialogBoxParam (GetModuleHandle(NULL),MAKEINTRESOURCE (IDD_DIALOG1),NULL,(DLGPROC) MainDialogProc,0);
    	return (0);
    }
    I get the following errors.

    Compiling...
    Winmain.cpp
    d:\rscript.rc(20) : error C2143: syntax error : missing ';' before 'constant'
    d:\rscript.rc(20) : error C2501: 'LANGUAGE' : missing storage-class or type specifiers
    d:\rscript.rc(20) : fatal error C1004: unexpected end of file found
    Error executing cl.exe.

    Trying.exe - 3 error(s), 0 warning(s)


    What's this error, and how do I fix this ?
    Thanks, in advance.

  3. #3
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    Your duplicate post has been deleted

  4. #4
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    You don't do it that way. The resource file, (.rc) should exist in the same directory as your other source files. Then go to Project-> Add to Project -> Files and select the .rc file. The header should be included in the source as you have done.

    I'll just say, I have never added a resource file created by the MFC app wizard before, you may get other problems if the resource file/header is assuming you are using MFC and the other souirce is not.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 10:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21