Hello,
Tutorial 10-1 is leaving me with questions.

1- resource.h is great and appreciated. However, I found that the constants were also defined in windows.inc. If it is not doubling the reference, what is the difference? Yah! I guess I don't know the difference between a header and an include file.

2- presuming that I do not possess that great resource.h file, is it from windows.inc that I can create one header.h file?

3- In dialog.rc you have: STYLE 0x0004. What does it refer to?

4- my visual c++ 6 is not giving me half the constants that you mention in your dialog.rc. I have the following:

IDD_OLE_PROPPAGE_SMALL DIALOG DISCARDABLE 10, 10, 209, 71
STYLE DS_3DLOOK | DS_CENTER | WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Our First Dialog Box"
BEGIN
DEFPUSHBUTTON "Say Hello",IDC_BUTTON,155,21,41,14
PUSHBUTTON "Exit",IDC_Exit,155,42,41,14
EDITTEXT IDC_EDIT,21,30,119,18,ES_AUTOHSCROLL
END

Since the missing constants don't seem to affect the behaviour, what should I think of it? No to worry because they are part of the defaults or add any other just in case?

5- my visual c++ is giving me the following:
IDD_OLE_PROPPAGE_SMALL as you can see in point 4,
is it proper to add the following in the myDialogResource.rc file:
#define IDD_OLE_PROPPAGE_SMALL MyDialog

also, I have in my resource.h file the following and it does not seem to matter that it is there or not with the above #define:
#define IDD_OLE_PROPPAGE_SMALL 104

thank you for your input.

Needless to say that the Icelion's tutorials are great.
cdnhermit
Posted on 2001-12-23 21:42:57 by cdnhermit

1- resource.h is great and appreciated. However, I found that the constants were also defined in windows.inc. If it is not doubling the reference, what is the difference? Yah! I guess I don't know the difference between a header and an include file.


The header is only used in the resource (.rc) file. It has some constants that the resource compiler (rc.exe) needs. You don't have to include (or translate it for) your asm files.


2- presuming that I do not possess that great resource.h file, is it from windows.inc that I can create one header.h file?


windows.inc contains constants used with programming the win32 api. the resource.h file contains constants used with resource scripts. Both are different things, so although both have a few constants in common (like window styles), you can't really compare both.


3- In dialog.rc you have: STYLE 0x0004. What does it refer to?

It's the window style in numeric form. You can also use constants (that's what resource.h is for!) like this:
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU

The 0x0004 is just one of those styles in numeric (hex) form.


4- my visual c++ 6 is not giving me half the constants that you mention in your dialog.rc. I have the following:

IDD_OLE_PROPPAGE_SMALL DIALOG DISCARDABLE 10, 10, 209, 71
STYLE DS_3DLOOK | DS_CENTER | WS_MINIMIZEBOX | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Our First Dialog Box"
BEGIN
DEFPUSHBUTTON "Say Hello",IDC_BUTTON,155,21,41,14
PUSHBUTTON "Exit",IDC_Exit,155,42,41,14
EDITTEXT IDC_EDIT,21,30,119,18,ES_AUTOHSCROLL
END

Since the missing constants don't seem to affect the behaviour, what should I think of it? No to worry because they are part of the defaults or add any other just in case?


Sorry I don't quite understand what you mean here.. Do you mean VC doesn't show you all styles defined in the resource script?


5- my visual c++ is giving me the following:
IDD_OLE_PROPPAGE_SMALL as you can see in point 4,
is it proper to add the following in the myDialogResource.rc file:
#define IDD_OLE_PROPPAGE_SMALL MyDialog

also, I have in my resource.h file the following and it does not seem to matter that it is there or not with the above #define:
#define IDD_OLE_PROPPAGE_SMALL 104


Maybe this constant is already defined elsewhere?

Thomas
Posted on 2001-12-26 17:23:22 by Thomas