-
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.
-
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)
-
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_TABSTOP, 200, 28, 50, 15
....
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
-
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.