Resources
Hi.
I am having problems with my C++ compiler.
I am using Borland C++ 5.2 and Windows 95.
The problem is, I can''t get it to work with resources. It compiles, it runs, but the resources haven’t worked?
Can you help me?
The problem is with all resources, this link will take you to the code I am using: http://www.winprog.org/tutorial/#1.8.
You will find the source code there and all of the resource files for download.
But like I say I think its more of a compiler problem, I probably have it set up wrong.
I don’t have any help files.
Thanks for your time.
Hmmm, Why is it always so hard.
Ok perhaps you don''t understand the situation I am in.
If I don''t get help with this soon, I am going to be locked up in a nice white hospital with rubber walls.
This isn''t funny, I have been every where done so much and still have nothing now help me. Ok this is not some little thing this is my life, I will have no chose but to lose my mind which I fear has already happened.
HOW THE FU$£ DO I USE RESOURCES
If I don''t get help with this soon, I am going to be locked up in a nice white hospital with rubber walls.
This isn''t funny, I have been every where done so much and still have nothing now help me. Ok this is not some little thing this is my life, I will have no chose but to lose my mind which I fear has already happened.
HOW THE FU$£ DO I USE RESOURCES
Hmmm, Why is it always so hard.
the most common problem (Andre LaMothe says it himself) is forgetting to use MAKEINTRESOURCE() for loading resources that are #defined with an ID. I can''t remember exactly how HE said it
but for example, if you''re trying to add a menu to your window class (ie WNDCLASSEX::lpszMenuName!=NULL) you might have to change the line to:
myWindowClass.lpszMenuName = MAKEINTRESOURCE(myMenuIdentifier);
hope that helps
but for example, if you''re trying to add a menu to your window class (ie WNDCLASSEX::lpszMenuName!=NULL) you might have to change the line to:
myWindowClass.lpszMenuName = MAKEINTRESOURCE(myMenuIdentifier);
hope that helps
"Be that word our sign in parting, bird or fiend!" I shrieked, upstarting —"Get thee back into the tempest and the Night''s Plutonian shore!-just 2 of 96 lines from E.A.P.'s "the Raven"
"NOTE: You may think I''m belaboring the difference between resources defined by string and by symbolic constant. However, taking into consideration that it''s the number one cause of self-mutilation amond Windows programmers, I think it''s worth the extra work -- don''t you?"
-Andre LaMothe
hehe. sounds like you fit into that category
-Andre LaMothe
hehe. sounds like you fit into that category
"Be that word our sign in parting, bird or fiend!" I shrieked, upstarting —"Get thee back into the tempest and the Night''s Plutonian shore!-just 2 of 96 lines from E.A.P.'s "the Raven"
I have Borland 5.02 and use Win 95 also. I have not had any problems in this respect.
I will give you somethings to look for.
-Always call this to make sure Windows has loaded the CC libraries
InitCommonControls();
-The below code will show the resource you have created
ghTabDlg = CreateDialog(
gInstance, // handle to application instance
MAKEINTRESOURCE(IDD_TABDLG),//identifies dialog box template name
hwnd2, // handle to owner window
(DLGPROC)TabDlgProc // pointer to dialog box procedure
);
-Borland automatically writes the indentifiers in your header file
-Here is an example
#define IDD_CHILDDLG 7
#define IDD_TABDLG 6
#define IDC_TABCONTROL1 101
-Borland also creates a .rc file as a default for WIN95 GUI targets
-Here is an example
/****************************************************************************
testtabs.rc
produced by Borland Resource Workshop
*****************************************************************************/
#define IDC_STATICRECT1 101
[clipped]
#include "testtabs.H"
IDD_TABDLG DIALOGEX 0, 0, 279, 295
EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_CONTEXTHELP
STYLE DS_MODALFRAME | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Resource Viewer"
FONT 8, "MS Sans Serif"
{
}
IDD_CHILDDLG DIALOGEX 0, -1, 276, 276
EXSTYLE WS_EX_CONTEXTHELP
STYLE DS_3DLOOK | DS_CONTEXTHELP | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_SYSMENU
CAPTION ""
FONT 8, "MS Sans Serif"
{
CONTROL "Rect1", IDC_STATICRECT1, "static", SS_GRAYRECT | SS_SUNKEN | WS_CHILD | WS_VISIBLE, 0, 0, 276, 276
CONTROL "Picture1", IDC_STATICBITMAP1, "static", SS_BITMAP |
...[clipped]
}
Edited by - Jack Sotac on February 25, 2001 2:31:18 PM
I will give you somethings to look for.
-Always call this to make sure Windows has loaded the CC libraries
InitCommonControls();
-The below code will show the resource you have created
ghTabDlg = CreateDialog(
gInstance, // handle to application instance
MAKEINTRESOURCE(IDD_TABDLG),//identifies dialog box template name
hwnd2, // handle to owner window
(DLGPROC)TabDlgProc // pointer to dialog box procedure
);
-Borland automatically writes the indentifiers in your header file
-Here is an example
#define IDD_CHILDDLG 7
#define IDD_TABDLG 6
#define IDC_TABCONTROL1 101
-Borland also creates a .rc file as a default for WIN95 GUI targets
-Here is an example
/****************************************************************************
testtabs.rc
produced by Borland Resource Workshop
*****************************************************************************/
#define IDC_STATICRECT1 101
[clipped]
#include "testtabs.H"
IDD_TABDLG DIALOGEX 0, 0, 279, 295
EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_CONTEXTHELP
STYLE DS_MODALFRAME | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Resource Viewer"
FONT 8, "MS Sans Serif"
{
}
IDD_CHILDDLG DIALOGEX 0, -1, 276, 276
EXSTYLE WS_EX_CONTEXTHELP
STYLE DS_3DLOOK | DS_CONTEXTHELP | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_SYSMENU
CAPTION ""
FONT 8, "MS Sans Serif"
{
CONTROL "Rect1", IDC_STATICRECT1, "static", SS_GRAYRECT | SS_SUNKEN | WS_CHILD | WS_VISIBLE, 0, 0, 276, 276
CONTROL "Picture1", IDC_STATICBITMAP1, "static", SS_BITMAP |
...[clipped]
}
Edited by - Jack Sotac on February 25, 2001 2:31:18 PM
0xa0000000
Hmmm, I have tried doing what you said but I couldn''t seem to find the bits of code you were pointing to.
How ever, I am pretty shore that the source code is fine as I got it from a good tutorial, all the source code up until now has worked fine.
Am I right in thinking to get resources to woke, you have to make them and put them in the same place as your program, then compiler the program and providing the code is all ok, it should run?
I am thinking that this is wrong, because I have the same compiler it was written on. So I think I must have to do something, but I don''t know what. Link it or something.
But then again it didn''t say any thing about this on the tutorial.
How ever, I am pretty shore that the source code is fine as I got it from a good tutorial, all the source code up until now has worked fine.
Am I right in thinking to get resources to woke, you have to make them and put them in the same place as your program, then compiler the program and providing the code is all ok, it should run?
I am thinking that this is wrong, because I have the same compiler it was written on. So I think I must have to do something, but I don''t know what. Link it or something.
But then again it didn''t say any thing about this on the tutorial.
Hmmm, Why is it always so hard.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement