Thread: resource editor....eh?

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    106

    resource editor....eh?

    Ok, I created a little dialog box (I am a newbie... doing really basic stuff now) with an OK and cancel button using Borland 5.02 resource editor. Well, how do I get the resource editor to make a header file with the dialog boxes ID numbers and everything?Any help would be appreciated...thanks.

  2. #2
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385

    iain

    if you are referring to a message box

    int value = MessageBox(hwnd, "Blah", "Blha", MB_YESNO);

    if (value==IDYES){process}
    else {process}

    otherwise you define them in a header file yourself s you do in a menu

    #define button idnumber

    (i think)
    Monday - what a way to spend a seventh of your life

  3. #3
    Registered User Chemanuel's Avatar
    Join Date
    Aug 2001
    Posts
    13
    To generate a header file you have two options:

    1) Look for a compiler that does that

    2) Do it yourself

    I use option 2)

    When you create any control in the resource editor you should give the control and ID. For example for OK and Cancel buttons you can use the standard from Windows

    IDOK and IDCANCEL (IDHELP is also standard).

    Then you don't need to include anything else. But if you use other ID's then you place them in a header file (*.h)

    Example:

    In resource (*.rc)

    PHP Code:
    #include <windows.h>
    #include "header.h"
    ....
         
    CONTROL "&My button"IDC_MY_BUTTON"BUTTON",
     
    BS_PUSHBUTTON WS_CHILD WS_VISIBLE WS_TABSTOP200285015
    .... 
    In header.h

    PHP Code:
    ....
    #define IDC_MY_BUTTON                   1000
    .... 

    And so on for each control.

    Then #include also the file header.h in your *.c or *.cpp file
    Last edited by Chemanuel; 08-14-2001 at 02:30 AM.
    Chemanuel

    Lo bueno si breve dos veces bueno (Baltasar Gracián 1601-1658)

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Borland also has a Resource Worskshop that will do all of the above for you - create all of your resource headers, dialog box templates, menus, bitmaps (source and MS binary), string tables, custom controls, and accelerator tables Unfortunately it probably only comes with a purchased product. If you are using the free download then you will have to code all of these yourself unless there is a freebee resource workshop out there somewhere.

    Follow all of the examples that have been given here in this thread and you should be well on your way, even though it is a bit tedious and time consuming to do it on your own.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Sorting out a resource manager
    By psychopath in forum Game Programming
    Replies: 1
    Last Post: 11-10-2008, 07:12 PM
  2. unmanaged resource
    By George2 in forum C++ Programming
    Replies: 2
    Last Post: 01-03-2008, 04:23 AM
  3. CreateProcess with Resource of executable, not the Filename
    By Ktulu in forum Windows Programming
    Replies: 4
    Last Post: 11-04-2006, 01:07 AM
  4. resource problem/question
    By stallion in forum Windows Programming
    Replies: 4
    Last Post: 01-29-2003, 02:08 PM
  5. Serial Communications in C
    By ExDigit in forum Windows Programming
    Replies: 7
    Last Post: 01-09-2002, 10:52 AM