Click here to Skip to main content
15,894,955 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRuntime error for OpenFileDialog Class in .NET 2005 Pin
priyank_ldce13-May-07 5:45
priyank_ldce13-May-07 5:45 
AnswerRe: Runtime error for OpenFileDialog Class in .NET 2005 Pin
Mark Salsbery13-May-07 5:54
Mark Salsbery13-May-07 5:54 
AnswerRe: Runtime error for OpenFileDialog Class in .NET 2005 Pin
Michael Dunn13-May-07 6:15
sitebuilderMichael Dunn13-May-07 6:15 
GeneralRe: Runtime error for OpenFileDialog Class in .NET 2005 Pin
Stephen Hewitt13-May-07 18:52
Stephen Hewitt13-May-07 18:52 
AnswerRe: Runtime error for OpenFileDialog Class in .NET 2005 Pin
Stephen Hewitt13-May-07 18:57
Stephen Hewitt13-May-07 18:57 
QuestionATL::CImage using HDC ??? Pin
guybour200613-May-07 4:33
guybour200613-May-07 4:33 
AnswerRe: ATL::CImage using HDC ??? Pin
Mark Salsbery13-May-07 5:45
Mark Salsbery13-May-07 5:45 
AnswerRe: ATL::CImage using HDC ??? Pin
bob1697213-May-07 7:46
bob1697213-May-07 7:46 
For starters, if you are trying to draw on on the view, you are getting a DC for the wrong window. Your getting a DC for the main frame window. From within you view class code, just use "this" since it is a pointer to the view/wnd

CDC* pDC=this->GetDC();
// or
CDC* pDC=GetDC();

Next, make sure the drawing code is in or called from the views OnDraw handler since anytime you drag another window over the view it will erase your drawing like an eraser. The OnDraw will get called and if your drawing code is not there to refresh the image, nothing will happen.

Next make sure you have the correct coordinate system for your drawing. The default mapping mode is MM_TEXT (y-axis positive as it goes down) all other mapping modes like MM_HIMETRIC, MM_HIENGLISH, etc... have the y-axis negative as it goes down. MM_ANISOTROPIC and MM_ISOTROPIC allow you to set the y-axis orientation. I've spent many an hour chasing my tail because my y-axis orientation was incorrect.

// The handle is a member of CDC. To access it use the arrow operator
pDC->m_hDC

// Something like
m_Image.StretchBlt(pDC->m_hDC, etc...



I hope that helps


QuestionStrange strcpy problem Pin
Axonn Echysttas13-May-07 2:17
Axonn Echysttas13-May-07 2:17 
AnswerRe: Strange strcpy problem Pin
Gary R. Wheeler13-May-07 2:31
Gary R. Wheeler13-May-07 2:31 
GeneralRe: Strange strcpy problem Pin
Axonn Echysttas13-May-07 3:09
Axonn Echysttas13-May-07 3:09 
GeneralRe: Strange strcpy problem Pin
Hans Dietrich13-May-07 3:47
mentorHans Dietrich13-May-07 3:47 
GeneralRe: Strange strcpy problem Pin
Axonn Echysttas13-May-07 4:17
Axonn Echysttas13-May-07 4:17 
GeneralRe: Strange strcpy problem Pin
Gary R. Wheeler13-May-07 4:32
Gary R. Wheeler13-May-07 4:32 
AnswerRe: Strange strcpy problem Pin
Michael Dunn13-May-07 6:18
sitebuilderMichael Dunn13-May-07 6:18 
QuestionMapping a drive into memory. Pin
Killer22512-May-07 23:23
Killer22512-May-07 23:23 
AnswerRe: Mapping a drive into memory. Pin
Hans Dietrich13-May-07 0:10
mentorHans Dietrich13-May-07 0:10 
AnswerRe: Mapping a drive into memory. Pin
Michael Dunn13-May-07 6:20
sitebuilderMichael Dunn13-May-07 6:20 
Questionvc++ related to xml Pin
biswajit nayak12-May-07 21:46
biswajit nayak12-May-07 21:46 
AnswerRe: vc++ related to xml Pin
Cedric Moonen12-May-07 22:01
Cedric Moonen12-May-07 22:01 
GeneralRe: vc++ related to xml Pin
Hans Dietrich13-May-07 0:12
mentorHans Dietrich13-May-07 0:12 
AnswerRe: vc++ related to xml Pin
Hamid_RT13-May-07 1:21
Hamid_RT13-May-07 1:21 
AnswerRe: vc++ related to xml Pin
#realJSOP13-May-07 3:57
mve#realJSOP13-May-07 3:57 
QuestionOne line miss problem Pin
hsuch12-May-07 19:26
hsuch12-May-07 19:26 
QuestionRe: One line miss problem Pin
bob1697212-May-07 20:06
bob1697212-May-07 20:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.