Enum declarations in resource file

This is a discussion on Enum declarations in resource file within the Windows Programming forums, part of the Platform Specific Boards category; Hello. How can I use enum declarations in my resource file? I'm getting a resource syntax error. ErrorStrings.rc: Code: # ...

  1. #1
    Registered User Ktulu's Avatar
    Join Date
    Oct 2006
    Posts
    62

    Enum declarations in resource file

    Hello.
    How can I use enum declarations in my resource file? I'm getting a resource syntax error.

    ErrorStrings.rc:
    Code:
    # include "ErrorStringIds.hpp"
    
    STRINGTABLE
    BEGIN
    
        SER_ERROR_FUNCTION_0x00, "A_Function_name"
        SER_ERROR_FUNCTION_0x01, "A_Function_name"
        SER_ERROR_FUNCTION_0x02, "A_Function_name"
        //etc etc.
    END
    Old ErrorStringIds.hpp without resource syntax error:
    Code:
    # define SER_ERROR_FUNCTION_0x00 0
    # define SER_ERROR_FUNCTION_0x01 1
    # define SER_ERROR_FUNCTION_0x02 2
    //etc etc
    New ErrorStringIds.hpp with resource syntax error:
    Code:
    enum ErrorFunction
    {
    
        SER_ERROR_FUNCTION_0x00 = 1,//[Resource error] syntax error 
        SER_ERROR_FUNCTION_0x01 = 2,
        SER_ERROR_FUNCTION_0x02 = 4
        //etc etc
    };
    I hope you get the picture, I want to use flags so I can combine error's to reduce the stringtable size.
    Thanks in advance, Ktulu. (I'm using Dev-C++).
    This parameter is reserved

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I'm pretty sure that the resource compiler will ONLY understand C preprocessor defintions [i.e. #define].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User Ktulu's Avatar
    Join Date
    Oct 2006
    Posts
    62
    Okey... is there a way to still use flags, if so, how?
    This parameter is reserved

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Ktulu View Post
    Okey... is there a way to still use flags, if so, how?
    Not sure what you want to do [never mind that I know about as much about resource editors as I've written in this thread - but perhaps if you clarify, someone else can help?]

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 01:44 PM
  2. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  3. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 05:14 AM
  4. Need help in resource file
    By Darkinyuasha1 in forum Windows Programming
    Replies: 7
    Last Post: 11-27-2006, 07:31 PM
  5. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 08:01 PM

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