after building everything It does not work. I do not believe I am understanding it correctly. This is what i put together from the tutorial. It says to build a .rc file not sure if this is correct. [code]
There are some example Win32 GUI projects in c:\devcpp\examples, look how they are put together. You also need the set the build options for a Win32GUI app. You might also start with the basic Win32 GUI template (File->New->Project). Either way you will need to start with a 'project'.
Next time post the Compile Log text so we can have at least some idea of what you are doing and how it fails!
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Actually they need to go back and read the tutorial again as they didnt follow it fully. Which is obvious by looking at the following line in the code they supplied.
wc.lpszMenuName = NULL;
So my advice to the poster is go back and read and follow the tutorial again.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well thank you for your advice, I went back and read the tutorial and realized what I done wrong. For one I did not have the correct resource file menu_one.ico and secondly, I did not remove the wc.lpszMenuName = NULL;
thanks again for the tip!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am working with this tutorial on win32 programming: http://www.winprog.org/tutorial/menus.html
after building everything It does not work. I do not believe I am understanding it correctly. This is what i put together from the tutorial. It says to build a .rc file not sure if this is correct.
[code]
include <windows.h>
include "resource.h"
//left off at page menus on : http://www.winprog.org/tutorial/menus.html
// added menu.rc
const char g_szClassName[] = "myWindowClass";
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_LBUTTONDOWN:
{
char szFileName[MAX_PATH];
HINSTANCE hInstance = GetModuleHandle(NULL);
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASSEX wc;
HWND hwnd;
MSG Msg;
//end of adding........................................................//
}
//resource.h file
define IDR_MYMENU 101
define IDI_MYICON 201
define ID_FILE_EXIT 9001
define ID_STUFF_GO 9002
//menu.rc file
include "resource.h"
IDR_MYMENU MENU
BEGIN
POPUP "&File"
BEGIN
MENUITEM "E&xit", ID_FILE_EXIT
END
END
IDI_MYICON ICON "menu_one.ico"
[/code]
"It does not work" is still unacceptable since there are so many ways in which anything may "not work".
So what does not work?
There are some example Win32 GUI projects in c:\devcpp\examples, look how they are put together. You also need the set the build options for a Win32GUI app. You might also start with the basic Win32 GUI template (File->New->Project). Either way you will need to start with a 'project'.
Next time post the Compile Log text so we can have at least some idea of what you are doing and how it fails!
Clifford
Actually they need to go back and read the tutorial again as they didnt follow it fully. Which is obvious by looking at the following line in the code they supplied.
wc.lpszMenuName = NULL;
So my advice to the poster is go back and read and follow the tutorial again.
Thanks guys,
Well thank you for your advice, I went back and read the tutorial and realized what I done wrong. For one I did not have the correct resource file menu_one.ico and secondly, I did not remove the wc.lpszMenuName = NULL;
thanks again for the tip!