Strange problem!!
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Strange problem!!

  1. #1
    Join Date
    Nov 2007
    Posts
    58

    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.

  2. #2
    Join Date
    Apr 1999
    Posts
    27,444

    Re: Strange problem!!

    Quote Originally Posted by pererm View Post
    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

  3. #3
    Join Date
    Dec 2012
    Location
    England
    Posts
    2,755

    Re: Strange problem!!

    I canīt understand why it fails.
    What's the debugger saying?
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

  4. #4
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,058

    Re: Strange problem!!

    How do you know it fails, as long as CDC::LPtoHIMETRIC returns void?
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

  5. #5
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,058

    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.
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

  6. #6
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,067

    Re: Strange problem!!

    Quote Originally Posted by 2kaud View Post
    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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center