467,188 Members | 1,460 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,188 developers. It's quick & easy.

Windows resource/.rc, .h files and GDI Functions, Fonts & Bitmaps

SHC
Hi all,
I saw the following 2 files used in the OpenGL and DirectX 9 programming:
1) resource.h
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by dx9_indexed_geometry.rc
//
#define IDC_MYICON 2
#define IDD_DIRECTX_DIALOG 102
#define IDD_ABOUTBOX 103
#define IDS_APP_TITLE 103
#define IDM_ABOUT 104
#define IDM_EXIT 105
#define IDS_HELLO 106
#define IDI_DIRECTX_ICON 107
#define IDC_DIRECTX_MENU 108
#define IDC_DIRECTX_ACCELERATOR 109
#define IDC_DIRECTX 110
#define IDR_MAINFRAME 128
#define IDC_STATIC -1

// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif
2) filenameXYZ.rc (opened by using Notepad)
// Microsoft Visual C++ generated resource script.
//
#include "resource.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#undef APSTUDIO_HIDDEN_SYMBOLS
#include "resource.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32

/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_DIRECTX_ICON ICON "codesampler.ico"

/////////////////////////////////////////////////////////////////////////////
//
// Menu
//

IDC_DIRECTX_MENU MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "E&xit", IDM_EXIT
END
POPUP "&Help"
BEGIN
MENUITEM "&About ...", IDM_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//

IDC_DIRECTX_ACCELERATOR ACCELERATORS
BEGIN
"/", IDM_ABOUT, ASCII, ALT, NOINVERT
"?", IDM_ABOUT, ASCII, ALT, NOINVERT
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_ABOUTBOX DIALOG 22, 17, 230, 75
STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "About"
FONT 8, "System"
BEGIN
ICON IDI_DIRECTX_ICON,IDC_MYICON,14,9,20,20
LTEXT "DirectX Sample v1.0",IDC_STATIC,49,10,119,8,SS_NOPREFIX
LTEXT "Copyright (C) 2001",IDC_STATIC,49,20,119,8
DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP
END
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

2 TEXTINCLUDE
BEGIN
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""windows.h""\r\n"
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
"#include ""resource.h""\r\n"
"\0"
END

3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END

1 TEXTINCLUDE
BEGIN
"resource.h\0"
END

#endif // APSTUDIO_INVOKED

#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////

#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
///////////////////////////////////////////////////////////////////////////
Issue #1: I do not know how the numerical numbers are decided and used in 1).
Issue #2: I have a hard to do the coding to create the .rc file like 2) for
Icon, Menu, Accelerator, Dialog, TEXTINCLUDE, etc.
Issue #3: Chapter 6 of Book "Programming with Microsoft Visual C++ .NET"
(Core Reference) by G. Shepherd with D. Kruglinski teaches Classic GDI
Functions, Fonts, and Bitmaps used in MFC. I do not know whether these GDI
Functions, Fonts and Bitmaps are related to the .rc file for Icon, Menu,
Accelerator, Dialog, TEXTINCULE, etc. Please help and address the
above-mentioned 3 issues for me or point out where I can find the answers for
them.

Thanks in adanve,
SHC
Nov 17 '05 #1
  • viewed: 3133
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Adam Dockter | last post: by
3 posts views Thread by Stuart Ferguson | last post: by
10 posts views Thread by Kamilche | last post: by
1 post views Thread by Nickneem | last post: by
7 posts views Thread by =?Utf-8?B?TWlrZQ==?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.