Tak jsem si stáhl Microsoft Visual c++ 2010
Měl bych jeden problém. Když chci vytvořit "resource.rc" a v něm MAINMENU (menu aplikace) tak to hází chyby.
spíš je chyba u mě ale nemaj se tam nainstalovat ještě nějaký patche?
Log:
1>------ Build started: Project: API, Configuration: Debug Win32 ------
1>
1>resource.rc(4): error RC2135: file not found: 40008
1>
1>
1>resource.rc(6): error RC2164: unexpected value in RCDATA
1>
1>
1>resource.rc(9): error RC2135: file not found: MENUITEM
1>
1>
1>resource.rc(10): error RC2135: file not found: MENUITEM
1>
1>
1>resource.rc(11): error RC2135: file not found: END
1>
1>
1>resource.rc(13): error RC2135: file not found: Aplikaci
1>
1>
1>resource.rc(14): error RC2135: file not found: END
1>
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Zde je zdroják resource.rc
#include "afxres.h"
#include "zdroje_private.h"
MAINMENU MENU DISCARDABLE
BEGIN
POPUP "&Něco"
BEGIN
MENUITEM "&Něco", IDM_NECO
MENUITEM "&Něco", IDM_NECO2
END
MENUITEM "&O Aplikaci", IDM_ABOUT
END
Zde je zdroják zdroje_private.h
#define MAINMENU 40008
#define IDM_ABOUT 40010
#define IDM_NECO 40011
#define IDM_NECO2 40011
Zde je zdroják main.cpp
#include <windows.h>
#include <iostream>
#include <string>
#include <cctype>
#include <fstream>
#include <cstring>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <winuser.h>
#include <clocale>
#include <locale.h>
#include <ctype.h>
#include <Vfw.h>
#include <conio.h>
#include <Lmcons.h>
#include "zdroje_private.h"
using namespace std;
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,PSTR szCmdLine, int iCmdShow)
{
TCHAR szAppName[] = TEXT("Pokusné okno");
HWND hWnd;
MSG msg;
WNDCLASSEX wc;
wc.cbSize = sizeof(wc);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = NULL;
wc.hIconSm = NULL;
wc.hCursor = NULL;
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wc.lpszMenuName = MAKEINTRESOURCE(MAINMENU);
wc.lpszClassName = szAppName;
RegisterClassEx(&wc);
hWnd = CreateWindowEx(0,szAppName,
szAppName,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,
CW_USEDEFAULT,
800,
650,
NULL,
NULL,
hInstance,NULL);
ShowWindow(hWnd, iCmdShow);
UpdateWindow(hWnd);
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message)
{
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
Můžete help?