我想在一静态static控件中动态显示一系列图片,采用定时器实现
WM_TIMER消息事件为如下
void CDiceDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
CBitmap bp; //用于保存位图资源;
switch(i)
{
case 1: bp.LoadBitmap(IDB_NUM_ONE);
m_DICE_MAP.SetBitmap(bp); //m_DICE_MAP 是一static的成员变量;
break;
case 2: bp.LoadBitmap(IDB_NUM_TWO);
m_DICE_MAP.SetBitmap(bp);
break;
case 3: bp.LoadBitmap(IDB_NUM_THREE);
m_DICE_MAP.SetBitmap(bp);
break;
case 4: bp.LoadBitmap(IDB_NUM_FOUR);
m_DICE_MAP.SetBitmap(bp);
break;
case 5: bp.LoadBitmap(IDB_NUM_FIVE);
m_DICE_MAP.SetBitmap(bp);
break;
case 6: bp.LoadBitmap(IDB_NUM_SIX);
m_DICE_MAP.SetBitmap(bp);
break;
default: i=1; //当到6开始循环;
}
i++;
}//请问各位高手,此处有无更好的办法实现上述功能;
编辑连接时无错误,可运行时发生的错误提示图大致如下Program:E:\My Project\vc\dice\debug\dice.exe
File:afxwin2.inl
Line:572
For information on how your program can cause an assertion
Failure,see the Visual C++ documentation on asserts.
(Press Retry to debug the application)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货