Hi all.
I have written a 'edit' program and it has a status bar, toolbar, edit space, but the only thing that works is the edit space....I have no errors either...
I will attatch the code.
Hi all.
I have written a 'edit' program and it has a status bar, toolbar, edit space, but the only thing that works is the edit space....I have no errors either...
I will attatch the code.
Hi
I sort of expanded the other program that i attatched in the last thread, but when i get to compiling it i get 1 error.
I get the error line at:Code:menu.rc [Resource error] parse error
I will attatch the main.c since that is quite a big file and i'll just type in the other files:Code:MENUITEM "N&ew", ID_FILE_NEW
Code://toolbar.h #define IDR_MYMENU 101 #define IDC_MAIN_TOOL 201 #define IDC_MAIN_EDIT 301 #define IDC_MAIN_STATUS 401 #define ID_FILE_EXIT 9001 #define ID_FILE_NEW 9002 #define ID_FILE_OPEN 9003 #define ID_FILE_SAVEAS 9004 #define ID_HELP_NO 9005any ideas, thanks in advance!Code://menu.rc #include "resource.h" IDR_MYMENU MENU BEGIN POPUP "&File" BEGIN MENUITEM "&Exit", ID_FILE_EXIT MENUITEM "N&ew", ID_FILE_NEW MENUITEM "O&pen", ID_FILE_OPEN MENUITEM "S&ave_as", ID_FILE_SAVEAS END POPUP "&Help" BEGIN MENUITEM "N&o", ID_HELP_NO END END
I have found one of the problems, i needed to take away a section of code. Here is my .rc file now:
But now the problem shows up on the next line, and it's the same errorCode://menu.rc #include "resource.h" IDR_MYMENU MENU BEGIN POPUP "&File" BEGIN MENUITEM "&Exit", ID_FILE_EXIT MENUITEM "N&ew", MENUITEM "O&pen", MENUITEM "S&ave_as", END POPUP "&Help" BEGIN MENUITEM "N&o", ID_HELP_NO END END
It's allright all, i didn't nead the resource file, so i recoded it
well, back to the first problem again.
Has anybody got any ideas?
Here is the header file:
Code://toolbar.h #define IDR_MYMENU 101 #define IDC_MAIN_TOOL 201 #define IDC_MAIN_EDIT 301 #define IDC_MAIN_STATUS 401 #define ID_FILE_EXIT 9001 #define ID_FILE_NEW 9002 #define ID_FILE_OPEN 9003 #define ID_FILE_SAVEAS 9004 #define ID_HELP_NO 9005
It isn't allright anymore?It's allright all, i didn't nead the resource file, so i recoded it
"The Internet treats censorship as damage and routes around it." - John Gilmore
- Your original resource file looks fine, except that it is including resource.h rather than toolbar.h which seems to be where the defines are.
- The trouble with the code in main.c is that it creates the child windows before the parent window, passing the uninitialised variable hwnd as their parent. The parent window should be created first. Some compilers, with the appropriate settings, will warn about the use of uninitialised variables (this is how I spotted the error without having to study the code). Without that warning, I would suggest you do a search for hwnd and make sure it is not used before its value is set.
- The sizing doesn't work yet, but your approach is correct, so I don't think you need help with it.
i don't see where i am going wrong, i can't see where i need to recode the parent/child window
oh, and by the way, i have added more to my main.c
I keep fidling about with the code, but the status bar is'nt visible, and the edit window is a bit 'skew-wif' anyway...
can anyone give me any ideas what to do, here is the updated code:
Last edited by beene; 10-20-2006 at 01:22 PM.
12 of 15 replies in this post have been made by you. Learn to use edit.
"The Internet treats censorship as damage and routes around it." - John Gilmore