|
|

楼主 |
发表于 2005-8-16 21:49:00
|
显示全部楼层
Re: Re:"未处理异常:写入位置0x********处访问冲突"...
♂樱♀: Re:"未处理异常:写入位置0x********处访问冲突"...救命啊
指针没new
请看代码:
int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
lpCmdLine, int nCmdShow)
{
if ( !InitWindow( hInstance, nCmdShow ) ) return FALSE; //创建主窗口
//如果创建不成功则返回FALSE并同时退出程序
MSG msg;
cgame=new Game(&hWnd);
//if(!cgame->Init())return FALSE;
//进入消息循环:
for(;;)
{
if(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if ( msg.message==WM_QUIT)
{
break;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else
{
if(!cgame->IsActive())continue;
cgame->Update();
//cgame->DisplayGameInfo();
//cgame->DisplayDebugInfo();
}
}
SAFE_DELETE(cgame)
return msg.wParam;
}
我new 了把 [em3] |
|