动态创建CbitmapButton的问题
我遇到了一个动态创建CbitmapButton的问题
在本程序的窗口中创建CbitmapButton窗口,显示出来了
//--------------------------------------
pBtnhere = new CBitmapButton;
CRect rBtn(50,100,100,150);
pBtnhere->Create(_T("on other Window"),BS_PUSHBUTTON|WS_VISIBLE|BS_OWNERDRAW, rBtn, this, 8002);
if(!pBtnhere->LoadBitmaps(_T("NameChang_U"), _T("NameChang_D"),NULL, _T("NameChang_X")))
{
TRACE0("Failed to load bitmaps for buttons\n");
AfxThrowResourceException();
}
pBtnhere->SizeToContent();
//--------------------------------------
但是在其他程序的窗口中创建CbitmapButton窗口,显示不出来,只显示出灰色的痕迹
//--------------------------------------
CWnd *pOtherWnd = CWnd::FindWindow(NULL, _T("OtherWnd "));
pBtnthere = new CBitmapButton;
pBtnthere->Create(_T("on other Window"),BS_PUSHBUTTON|WS_VISIBLE|BS_OWNERDRAW, rBtn, pOtherWnd , 8002);
if(!pBtnthere->LoadBitmaps(_T("NameChang_U"), _T("NameChang_D"),NULL, _T("NameChang_X")))
{
TRACE0("Failed to load bitmaps for buttons\n");
AfxThrowResourceException();
}
pBtnthere->SizeToContent();
//--------------------------------------
如过不是有位图的时候,只显示文字的话,现实的挺好的,就是一有位图就不行了
难道是位图资源搞不到其他程序上去?
请解释解释