Salve ragazzi, ho appena scritto questo codice, che stranamente viene compilato ma non viene visualizzata la finestra...
il compilatore rilascia però due wairning
1>c:\users\salvatore\documents\visual studio 2010\projects\dirextx\dirextx\main.c(19): warning C4047: 'funzione': 'DWORD' differisce da 'void *' nei livelli di riferimento indiretto
1>c:\users\salvatore\documents\visual studio 2010\projects\dirextx\dirextx\main.c(19): warning C4024: 'CreateWindowExA': tipi diversi tra il parametro 1 formale e quello effettivo
codice:
#include <Windows.h>
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){
WNDCLASSEX WindowsClass;
HWND handle;
ZeroMemory(&WindowsClass, sizeof(WNDCLASSEX));
WindowsClass.cbSize = sizeof(WNDCLASSEX);
WindowsClass.lpszClassName = "DirectX";
WindowsClass.hCursor = NULL;
WindowsClass.style = CS_HREDRAW | CS_VREDRAW ;
WindowsClass.hInstance = hInstance;
WindowsClass.lpfnWndProc = WndProc;
WindowsClass.hbrBackground = (HBRUSH)COLOR_WINDOW;
RegisterClassEx(&WindowsClass);
handle = CreateWindowEx(NULL, "DirectX", "Salvatore", WS_OVERLAPPEDWINDOW, 300, 300, 300, 300, NULL, NULL, hInstance, NULL);
ShowWindow(handle, nShowCmd);
UpdateWindow(handle);
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
return 0;
}