Resource question

This is a discussion on Resource question within the Windows Programming forums, part of the Platform Specific Boards category; Hey guys, I am trying to learn Windows programming. I found theForgers tutorial and I had a question about it. ...

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    49

    Resource question

    Hey guys,

    I am trying to learn Windows programming. I found theForgers tutorial and I had a question about it. It says that in the resources.h header file you have to assign an integer to each resource when you define it, like...

    Code:
    #define IDR_MYMENU 101
    #define IDI_MYICON 201
    
    #define ID_FILE_EXIT 9001
    #define ID_STUFF_GO 9002
    Are the number completely random? Can I enter anything (aside from negative numbers or decimals)? Is there a limit? Thanks.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    They aren't random, but they are arbitrary. However, there probably is some reserved area, I think below 100, for the system. Also, the upper limit might be as low as ~32000 (2^15-1), but that's only a worst-case scenario.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 01:14 PM
  2. Sorting out a resource manager
    By psychopath in forum Game Programming
    Replies: 1
    Last Post: 11-10-2008, 07:12 PM
  3. WIN32 API Controls used with Resource
    By parad0x13 in forum C++ Programming
    Replies: 0
    Last Post: 07-19-2008, 03:05 PM
  4. Loading an image in from a resource file
    By starcatcher in forum C++ Programming
    Replies: 4
    Last Post: 04-15-2008, 07:44 AM
  5. Lame question on dialog controls appearance
    By Templario in forum Windows Programming
    Replies: 2
    Last Post: 03-18-2003, 08:22 PM

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