MAKEINTRESOURCE() gdi+ 出错,返回空
在VC8中,我用了:
USES_CONVERSION;
Bitmap * m_bmpSurface = Bitmap::FromResource( AfxGetApp()->m_hInstance, A2W((LPCSTR)MAKEINTRESOURCE(IDB_BITMAP1)));
//???????????
if(!m_bmpSurface) {
AfxMessageBox(_T("fail to load bitmap"));
return;
}
跟踪程序后;
程序进入到函数:
inline LPWSTR WINAPI AtlA2WHelper(__out_ecount(nChars) LPWSTR lpw, __in LPCSTR lpa, __in int nChars, __in UINT acp) throw()
{
ATLASSERT(lpa != NULL);
ATLASSERT(lpw != NULL);
if (lpw == NULL || lpa == NULL)
return NULL;
// verify that no illegal character present
// since lpw was allocated based on the size of lpa
// don't worry about the number of chars
lpw[0] = '\0';
??????????int ret = MultiByteToWideChar(acp, 0, lpa, -1, lpw, nChars);
if(ret == 0)
{
ATLASSERT(FALSE);
return NULL;
}
return lpw;
}
其中:lpa为空,从而产生错误
请教,怎么解决; 谢谢