Trying to compile simple C program with rc file

This is a discussion on Trying to compile simple C program with rc file within the Windows Programming forums, part of the Platform Specific Boards category; Hello all, first post, so be gentle... I am trying to learn the Win32 API having spent many years programming ...

  1. #1
    Registered User
    Join Date
    Jan 2014
    Posts
    2

    Trying to compile simple C program with rc file

    Hello all, first post, so be gentle...

    I am trying to learn the Win32 API having spent many years programming the RISC OS WIMP.

    I am using C with the Code:Block front end and GCC compiler.

    I have a simple .rc resource file which seems to refuse to compile, the compiler throws up an error

    error: expected identifier or '(' before numeric constant

    The rc file is this:
    // Generated by ResEdit 1.5.11
    // Copyright (C) 2006-2012
    // ResEdit Resource Editor - free resource editor for Win32
    #include <windows.h>
    #include "resource.h"

    //
    // Dialog resources
    //
    //LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
    IDD_wimp_error DIALOGEX 0, 0, 186, 95
    STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
    CAPTION "Dialog"
    FONT 8, "Ms Shell Dlg"
    BEGIN
    DEFPUSHBUTTON "OK", DBIDOK, 129, 7, 50, 14
    PUSHBUTTON "Cancel", DBIDCANCEL, 129, 24, 50, 14
    END

    I cannot see why the compiler will not accept the line defining the dialogue box

    IDD_wimp_error DIALOGEX 0, 0, 186, 95

    The resource file "resource.h" does include values for IDD_wimp_error and DBIDOK and DBIDCANCEL

    Any help is much appreciated.

    David

  2. #2
    Registered User
    Join Date
    Jan 2014
    Posts
    2
    Quote Originally Posted by UKDave View Post
    Hello all, first post, so be gentle...

    I am trying to learn the Win32 API having spent many years programming the RISC OS WIMP.

    I am using C with the Code:Block front end and GCC compiler.

    I have a simple .rc resource file which seems to refuse to compile, the compiler throws up an error

    error: expected identifier or '(' before numeric constant

    The rc file is this:
    // Generated by ResEdit 1.5.11
    // Copyright (C) 2006-2012
    // ResEdit Resource Editor - free resource editor for Win32
    #include <windows.h>
    #include "resource.h"

    //
    // Dialog resources
    //
    //LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
    IDD_wimp_error DIALOGEX 0, 0, 186, 95
    STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
    CAPTION "Dialog"
    FONT 8, "Ms Shell Dlg"
    BEGIN
    DEFPUSHBUTTON "OK", DBIDOK, 129, 7, 50, 14
    PUSHBUTTON "Cancel", DBIDCANCEL, 129, 24, 50, 14
    END

    I cannot see why the compiler will not accept the line defining the dialogue box

    IDD_wimp_error DIALOGEX 0, 0, 186, 95

    The resource file "resource.h" does include values for IDD_wimp_error and DBIDOK and DBIDCANCEL

    Any help is much appreciated.

    David
    Hello All, sorted it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 04-27-2011, 09:46 PM
  2. simple program with svgalib = no compile?
    By IM back! in forum C++ Programming
    Replies: 1
    Last Post: 05-29-2008, 03:10 PM
  3. win32 can not compile simple program
    By zee in forum Windows Programming
    Replies: 14
    Last Post: 01-10-2006, 05:43 PM
  4. Compile Program missing .lib file have .dll
    By John Hobbes in forum C++ Programming
    Replies: 1
    Last Post: 11-19-2004, 04:52 PM
  5. Can't Compile a Simple Program
    By pmoscatt in forum C++ Programming
    Replies: 18
    Last Post: 02-10-2002, 04:14 AM

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