Click here to Skip to main content
15,894,540 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I have a piece of code as below..,

m_pMem->Create(*this);
m_pMem->SetMap(MM_ANISOTROPIC);
m_pMem->SetOrg(0, 0);
m_pMem->SetExt(m_SamplesOnWindow / SamplingFactor, SHRT_MAX);
HDC dc = *m_pMem;
colors->SelectPalette(dc); // error at this line..,

At runtime an error shows like " Access Violation Writing *address* "

The debugger shows error for variable DC like " cxx0030 : Error : Cannot be evaluated "

I am unable to find out as to why there is runtime anomality.
Any help on this regard will be much appreciated..,

Thanks in Advance..,
Posted

1 solution

Try this:

C++
HDC dc = m_pMem->GetSafeHdc();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900