void main() {// create a bit map //CBitmap bitmap; // load bitmap //bitmap.LoadBitmapW(11111); CBitmap Bitmap; Bitmap.LoadBitmapW(11111); //bitmap.LoadBitmapW(11111); //加载位图,位图ID为IDB_BITMAP01,是已经导入Visual Studio的了 //BITMAP bmp; //bitmap.GetBitmap(&bmp); //cout<<bmp.bmWidth<<endl;} 为什么这样会提示 File:f:\rtm\vctools\vs7libs\ship\atlmfc\include\afxwin1.inl Line:24 For information on how your program can cause an assertion failure, seee the Visual C++ documentation on asserts. (Press Retry to debug the application)
{// create a bit map
//CBitmap bitmap;
// load bitmap
//bitmap.LoadBitmapW(11111);
CBitmap Bitmap;
Bitmap.LoadBitmapW(11111);
//bitmap.LoadBitmapW(11111);
//加载位图,位图ID为IDB_BITMAP01,是已经导入Visual Studio的了
//BITMAP bmp;
//bitmap.GetBitmap(&bmp);
//cout<<bmp.bmWidth<<endl;}
为什么这样会提示
File:f:\rtm\vctools\vs7libs\ship\atlmfc\include\afxwin1.inl
Line:24
For information on how your program can cause an assertion
failure, seee the Visual C++ documentation on asserts.
(Press Retry to debug the application)
“每次用/*...*/注释掉不同部分再重新编译,直到定位到具体语法出错的位置。”
的方法解决的。VC编译选项加/EP /P,重新编译,查看宏展开后对应的.i文件。gcc加-E