CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Location
    Monte Carlo
    Posts
    129

    Mods: Please delete me.

    I'm suspect it might have something to do with the handle, but I can't find any good documentation on this.

    Basically I have an old, legacy VC++ 6.0 app that does some work with the old metafile format. In the process of converting it to Enhanced Metafile format I call SetWinMetaBits.
    As the title says, after about 4K iterations, I get a NULL handle and CANNOT recover. Whatever I do, wherever I go, who ever I see, that method will return NULL forever until I restart the app.


    MODS: Looking for a way to delete this post.

    I see no clear mechanism where one can delete a post. Is this possible? Thanks.
    Last edited by mega Kluge; January 12th, 2015 at 02:27 PM. Reason: Clarification

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Mods: Please delete me.

    Quote Originally Posted by mega Kluge View Post
    ... Looking for a way to delete this post.

    I see no clear mechanism where one can delete a post. Is this possible? Thanks.
    And what is the reason to delete it?
    Victor Nijegorodov

  3. #3
    Join Date
    Jun 2002
    Location
    Monte Carlo
    Posts
    129

    Re: Old school SetWinMetaFileBits() fails after ~4K iterations. What am I missing h

    Hi Victor,

    Well, maybe this post might be worth something after all. The SetWinMetaBits was failing due to GDI handle leak elsewhere in the code. There was an HDC that wasn't being released properly. This manifested (eventually) to the SetWinMetaBits failing in an entirely different method. Once the HDC was released, the function stopped returning a NULL HENHMETAFILE and all is working properly.

    Maybe this will help someone else at some point.

    Thanks for your time.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured