Device Context in XP problem
Hi Frendz,
I am working in an application in VC++ 6.0 in Windows 98
platform for drawing images.It works well in win 98 . I am trying to
import the same application for Windows XP. While doing this the DEVICE
CONTEXT creates problem.
///////////////////MY CODE//////////////
int CPicture::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
CPaintDC dc(this);
CRect clientRect;
CPageWindow *page=(CPageWindow *)GetParent();
if(page)
{
clientRect.SetRect(0,0,page->Width,-page->Height);
int oldmapmode=dc.SetMapMode(MM_HIENGLISH);
dc.LPtoDP(&clientRect);
dc.SetMapMode(oldmapmode);
}
m_memDC=new CDC();
m_memBitmap=new CBitmap();
m_memDC->CreateCompatibleDC(&dc);
m_memBitmap->CreateCompatibleBitmap(&dc,clientRect.Width(),clientRect.Height());
m_pOldMemBitmap=m_memDC->SelectObject(m_memBitmap);
return 0;
}
/////////////////////////// end of code/////////////
My problem is after converting from LPtoDP the client rect value is
top=0 bottom=1680 left=0 right= 1054 clientrect(0 1680 0 1054)
in Windows 98 the LPtoDP the client rect value is ient rect value is
top=0 bottom=1984 left=0 right= 1245 clientrect(0 1984 0 1245)
because of this change in the dc the picture position changes..... Can
u pl help how to make the DC compatible for windows xp from wimdows 98
Thanx in advance
Mulls