求救! 本机运行正常,在有的机器上报错:必须的资源无法得到 !!!!
我写了一个小工具,在本机上无论静态还是动态都已经调试通过,但是拿到一个没有安装VC的机器上就报错,说必需的资源无法得到。不知道哪里的问题。请高手帮忙。
我的OnPaint是这样写的,请问有问题吗?
有人说dc需要释放,如何释放啊?
void CDataBackupDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}