在设置游戏引擎的成员变量时出现的问题,求解
这是游戏引擎的构造函数,编译没问题,运行时报错,m_szTitle和szTitle 错误的指针
,this也出问题了,值:0xe808458b{m_hInstance=???m_hWindow=???m_szWindowClass=0xe等等}
m_szTitle的类型是wchar_t [100],szTitle的类型是wchar_t*
//游戏引擎的构造函数;
GameEngine::GameEngine(HINSTANCE hInstance, LPTSTR szWindowClass, LPTSTR szTitle, WORD wIcon, WORD wSmallIcon,
int iWidth, int iHeight)
{
//设置游戏引擎的成员变量;
m_pGameEngine= this;
m_hInstance= hInstance;
m_hWindow= NULL;
if(lstrlen(szWindowClass) > 0)
lstrcpy(m_szWindowClass, szWindowClass);
if(lstrlen(szTitle) > 0)
lstrcpy(m_szTitle, szTitle);
m_wIcon= wIcon;
m_wSmallIcon= wSmallIcon;
m_iWidth= iWidth;
m_iHeight= iHeight;
m_iFrameDelay= 20;
m_bSleep= TRUE;
}