This topic is now archived and is closed to further replies.


plz all the nice people check it and help

Recommended Posts

plz plz plz run this code on VC++ and solve the linking error it can compile but cannot build plz plz plz help me..........#define WIN32_LEAN_AND_MEAN #define INITGUID #include <windows.h> #include <windowsx.h> #include <stdio.h> #include <math.h> #include <iostream.h> #include <conio.h> #include <mmsystem.h> #include <stdlib.h> #include <malloc.h> #include <memory.h> #include <string.h> #include <stdarg.h> #include <io.h> #include <fcntl.h> //DEFINES //defines for the window #define WINDOW_CLASS_NAME "WIN3DCLASS" #define WINDOW_TITLE " GOD HELP US Graphics Console Alpha ver 1.0" #define WINDOW_WIDTH 320 #define WINDOW_HEIGHT 240 //keyboard init #define KEY_DOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000)?1:0) #define KEY_UP(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000)?1:0) int Game_Init(void *parms=NULL); int Game_Shutdown(void *parms=NULL); int Game_Main(void *parms=NULL); HWND main_window_handle = NULL;//save the window handle HINSTANCE main_instance = NULL;// save the instance char buffer[256]; // used to print text //functions LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { PAINTSTRUCT ps; HDC hdc; switch(msg) { case WM_CREATE: { //do initialization here return(0); } break; case WM_PAINT: { hdc = BeginPaint(hwnd,&ps); EndPaint(hwnd,&ps); return(0); }break; case WM_DESTROY: { // kill the application PostQuitMessage(0); return(0); }break; default:break; }//end switch // process any messages that we didn''t take care of return(DefWindowProc(hwnd,msg,wparam,lparam)); }//end WinProc //WIN MAIN int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow) { WNDCLASS winclass; // this will hold the class we create HWND hwnd; //generic window handle MSG msg; //generic message // HDC hdc; // generic dc // PAINTSTRUCT ps; // = CS_DBLCLKS | CS_OWNDC|CS_HREDRAW|CS_VREDRAW; winclass.lpfnWndProc = WindowProc; winclass.cbClsExtra = 0; winclass.cbWndExtra = 0; winclass.hInstance = hinstance; winclass.hIcon = LoadIcon(NULL,IDI_APPLICATION); winclass.hCursor = LoadCursor(NULL, IDC_ARROW); winclass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); winclass.lpszMenuName = NULL; winclass.lpszClassName = WINDOW_CLASS_NAME; // register the windowclass if(!RegisterClass(&winclass)) return(0); if(!(hwnd = CreateWindow(WINDOW_CLASS_NAME,WINDOW_TITLE, WS_OVERLAPPED|WS_SYSMENU|WS_CAPTION,0,0, WINDOW_WIDTH,WINDOW_HEIGHT,NULL,NULL,hinstance,NULL))) return(0); main_window_handle = hwnd; main_instance = hinstance; ShowWindow(main_window_handle,SW_SHOW); Game_Init(); while(1) { if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)) { if(msg.message == WM_QUIT) break; TranslateMessage(&msg); DispatchMessage(&msg); } Game_Main(); } Game_Shutdown(); return(msg.wParam); } int Game_Init(void *parms) { // in this function u initialize all game stuff //return success return(1); } int Game_Shutdown(void *parms) { // in this function u release ur all resources return(1); } int Game_Main(void *parms) { // game logic if(KEY_DOWN(VK_ESCAPE)) { PostMessage(main_window_handle,WM_DESTROY,0,0); } //returnsuccess return(1); }

Share this post

Link to post
Share on other sites