Click here to Skip to main content
15,903,362 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWho Calls main and where does main returns (C/C++) Pin
Ranjish27-Oct-04 18:55
Ranjish27-Oct-04 18:55 
GeneralRe: Who Calls main and where does main returns (C/C++) Pin
Sujan Christo27-Oct-04 21:52
Sujan Christo27-Oct-04 21:52 
GeneralRe: Who Calls main and where does main returns (C/C++) Pin
jan larsen28-Oct-04 4:14
jan larsen28-Oct-04 4:14 
AnswerRe: Why cann't get main window's CDC? Pin
Ryan Binns27-Oct-04 18:21
Ryan Binns27-Oct-04 18:21 
GeneralRe: Why cann't get main window's CDC? Pin
legenderious27-Oct-04 19:45
legenderious27-Oct-04 19:45 
GeneralRe: Why cann't get main window's CDC? Pin
Antony M Kancidrowski28-Oct-04 5:26
Antony M Kancidrowski28-Oct-04 5:26 
AnswerRe: Why cann't get main window's CDC? Pin
Antony M Kancidrowski28-Oct-04 5:23
Antony M Kancidrowski28-Oct-04 5:23 
GeneralRe: Why cann't get main window's CDC? Pin
legenderious28-Oct-04 15:32
legenderious28-Oct-04 15:32 
there is no ..if.. else ..in the original code ,And I called the ReleaseDC().when i found the problem,I add it . I checked the returned value of ReleaseDC(),it's successful everytime.

I have checked all the GetDC in my programm,it realeased OK.

now i do it as follows:
CDC pDC;
if(pDC.Attach(hDC))
{
pDC.BitBlt(rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(), &m_dcMap, rcClient.left, rcClient.top, SRCCOPY);
}
else
{
TRACE("\ncann't get parent DC\n");
strTemp = "cann't get parent DC";
((CFMapCtrl*)m_pParent)->WriteLogFile(strTemp);
}
pDC.Detach();

hDC is saved at the initial time.

it seems better.
GeneralRe: Why cann't get main window's CDC? Pin
Antony M Kancidrowski29-Oct-04 1:57
Antony M Kancidrowski29-Oct-04 1:57 
QuestionWhy cann't get main window's CDC? Pin
legenderious27-Oct-04 16:41
legenderious27-Oct-04 16:41 
AnswerRe: Why cann't get main window's CDC? Pin
ytod27-Oct-04 17:01
ytod27-Oct-04 17:01 
GeneralRe: Why cann't get main window's CDC? Pin
legenderious27-Oct-04 19:49
legenderious27-Oct-04 19:49 
GeneralRe: Why cann't get main window's CDC? Pin
ytod27-Oct-04 20:53
ytod27-Oct-04 20:53 
GeneralRe: Why cann't get main window's CDC? Pin
legenderious28-Oct-04 16:10
legenderious28-Oct-04 16:10 
GeneralOpen the other Application Pin
ytod27-Oct-04 16:09
ytod27-Oct-04 16:09 
GeneralRe: Open the other Application Pin
bryce27-Oct-04 17:52
bryce27-Oct-04 17:52 
GeneralRe: Open the other Application Pin
ytod27-Oct-04 17:59
ytod27-Oct-04 17:59 
GeneralRe: Open the other Application Pin
ThatsAlok27-Oct-04 18:47
ThatsAlok27-Oct-04 18:47 
GeneralRe: Open the other Application Pin
Ranjish27-Oct-04 18:43
Ranjish27-Oct-04 18:43 
GeneralInteractive Online Course. Pin
Zak_Man27-Oct-04 15:50
Zak_Man27-Oct-04 15:50 
Generalreading in a text file Pin
Programmer_Chris27-Oct-04 14:54
Programmer_Chris27-Oct-04 14:54 
GeneralRe: reading in a text file Pin
digwizfox27-Oct-04 15:12
digwizfox27-Oct-04 15:12 
GeneralRe: reading in a text file Pin
Christian Graus27-Oct-04 15:25
protectorChristian Graus27-Oct-04 15:25 
GeneralProblem dealing with a function definition Pin
NietzscheDisciple27-Oct-04 10:47
NietzscheDisciple27-Oct-04 10:47 
GeneralRe: Problem dealing with a function definition Pin
Anonymous29-Oct-04 5:35
Anonymous29-Oct-04 5:35 

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.