019
18.03.2006, 11:52 Uhr
Mr Evil
|
ich hab das so gemach
ne eigene include mit den ganzen headern und defines
C++: |
#pragma once #ifndef _SECURE_ATL #define _SECURE_ATL 1 #endif #ifndef _AFCDLL #define _AFXDLL #endif #ifndef VC_EXTRALEAN #define VC_EXTRALEAN #endif #ifndef WINVER #define WINVER 0x0501 #endif #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #ifndef _WIN32_WINDOWS #define _WIN32_WINDOWS 0x0410 #endif #ifndef _WIN32_IE #define _WIN32_IE 0x0600 #endif #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS #define _AFX_ALL_WARNINGS #include <afxwin.h> #include <afxext.h> #ifndef _AFX_NO_OLE_SUPPORT #include <afxdtctl.h> #endif #ifndef _AFX_NO_AFXCMN_SUPPORT #include <afxcmn.h> #endif // _AFX_NO_AFXCMN_SUPPORT #ifdef _UNICODE #if defined _M_IX86 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") #elif defined _M_IA64 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"") #elif defined _M_X64 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") #else #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") #endif #endif
|
und dann in der main cpp
C++: |
#include "std.h" #include "funk.h"
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ) { WNDCLASS WndClass; WndClass.style = 0; WndClass.cbClsExtra = 0; WndClass.cbWndExtra = 0; WndClass.lpfnWndProc = WndProc; WndClass.hInstance = hInstance; WndClass.hbrBackground = ( HBRUSH ) ( COLOR_WINDOW ); WndClass.hCursor = 0; WndClass.hIcon = 0; WndClass.lpszMenuName = 0; WndClass.lpszClassName = L"WinProg";
RegisterClass( &WndClass );
HWND hWindow; hWindow = CreateWindow( L"WinProg", L"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 ( int ) Message.wParam; }
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Befehle Abfangen LRESULT CALLBACK WndProc( HWND hWnd, UINT uiMessage, WPARAM wParam, LPARAM lParam ) { Funktionen* fu = new Funktionen();
switch( uiMessage ) { case WM_PAINT: fu->CreateLabels( hWnd, uiMessage, wParam, lParam ); return 0; case WM_DESTROY: PostQuitMessage( 0 ); return 0; default: return DefWindowProc( hWnd, uiMessage, wParam, lParam ); } }
|
die methoden createlabels zb hab ich in der Funktionen klasse in der methoden.cpp
du meinst das ist murks ? das wenn ich schon mfc mach, das ich ein mfc projekt erstellen lass, und darauf dann progge ? Dieser Post wurde am 18.03.2006 um 11:54 Uhr von Mr Evil editiert. |