morgen,
hab mich mal bissel mit winapi auseinander gesetzt. das is mein erstes fenster. bloß gehts net. für was is stdafx.h den header hat vc++ erstellt.
fehler beim compilieren:
neu1\neu1.cpp(2) : fatal error C1083: Cannot open precompiled header file: 'Debug/neu1.pch': No such file or directory
das is die header datei:
und ohne diesen header kommt das:
cpp(48) : fatal error C1010: unexpected end of file while looking for precompiled header directive
thx bye
hab mich mal bissel mit winapi auseinander gesetzt. das is mein erstes fenster. bloß gehts net. für was is stdafx.h den header hat vc++ erstellt.
Code:
#include "stdafx.h"
#include <windows.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
WNDCLASS WndClass;
WndClass.style = 0;
WndClass.cbClsExtra = 0;
WndClass.cbWndExra = 0;
WndClass.1pfnWndProc = WndProc;
WndClass.hInstance = hInstance;
WndClass.hbrBackground = (HBRUSH) (COLOR_WINDOW+1);
WndClass.hCursor = 0;
WndClass.hIcon = 0;
WndClass.1pszMenuName = 0;
WndClass.lpszClassName = "Winproc";
RegisterClass(&WndClass);
HWND hWindow;
hWindow = CreateWindow("Winproc","Fenster",
WS_OVERLAPPEDWINDOW,
0,0,400,400,NULL,NULL,
hInstance, NULL);
ShowWindow (hWindow, nCmdShow);
UpdateWindow (hWindow);
MSG Message;
while (GetMessage(&Message, NULL, 0, 0))
{
DispatchMessage(&Message);
}
return (Message.wParam);
}
LRESULT CALLBACK WndProc (HWND hWnd, UINT uiMessage,
WPARM WPARAM wParam,LPARAM lParam)
{
switch(uiMessage)
{
case WM_DESTROY:
POSTQUITMESSAGE(0);
return 0;
default:
return DefWindowProc (hWnd, uiMessage,
WParam, lParam);
}
}
}
fehler beim compilieren:
neu1\neu1.cpp(2) : fatal error C1083: Cannot open precompiled header file: 'Debug/neu1.pch': No such file or directory
das is die header datei:
Code:
// stdafx.cpp : source file that includes just the standard includes
// neu1.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
und ohne diesen header kommt das:
cpp(48) : fatal error C1010: unexpected end of file while looking for precompiled header directive
thx bye

Zuletzt bearbeitet: