-
November 21st, 2013, 01:16 PM
#1
Strange problem!!
I use the function:
pdc->LPtoHIMETRIC(&size);
where pdc is a CDC object : pdc = pView->GetDC()
During a long time this function returns the correct values, but now when my routines call that function the pdc fails.
I can´t understand why it fails. Can anyone help me , please.
-
November 21st, 2013, 01:57 PM
#2
Re: Strange problem!!
Originally Posted by pererm
I use the function:
pdc->LPtoHIMETRIC(&size);
where pdc is a CDC object : pdc = pView->GetDC()
During a long time this function returns the correct values, but now when my routines call that function the pdc fails.
I can´t understand why it fails. Can anyone help me , please.
And the value of pView is...?
Also, please define what you mean by "pdc fails". Is it NULL? It isn't NULL but doesn't "work" correctly? Etc...
Regards,
Paul McKenzie
-
November 21st, 2013, 03:08 PM
#3
Re: Strange problem!!
I can´t understand why it fails.
What's the debugger saying?
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
C++23 Compiler: Microsoft VS2022 (17.6.5)
-
November 22nd, 2013, 02:50 AM
#4
Re: Strange problem!!
How do you know it fails, as long as CDC::LPtoHIMETRIC returns void?
-
November 22nd, 2013, 03:28 AM
#5
Re: Strange problem!!
...anyway, the most common cause of GDI malfunction after a while, is having GDI leaks. That means, creating GDI objects (brushes, pens, fonts, etc) without destroying them when they are no more necessary. Also, you must take care of releasing GDI objects from DC before destroying them.
-
November 22nd, 2013, 07:39 AM
#6
Re: Strange problem!!
Originally Posted by 2kaud
What's the debugger saying?
Ring ding dingeding ding ding ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|