CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    11

    Please explain ambiguity

    I have stand-alone owner-draw button to use as "Close." MFC source file defines OnAppExit(): m_pMainWnd->SendMessage(WM_CLOSE). Even has comment stating: "Same as clicking close button in upper right corner." In my view class, define handler for button: AfxGetApp()->m_pMainWnd->SendMessage(WM_CLOSE). App closes fine. Here's problem: Memory leak when using owner-draw button. Among others, DocTemplate not deallocating. Using default "X" button, no leaks. Has me baffled. Any suggestions? Thanks.

    Tom


  2. #2
    Join Date
    May 1999
    Location
    Toronto, Ontario, Canada
    Posts
    155

    Re: Please explain ambiguity

    Use PostMessage instead. It is safer as SendMessage acts much like a function call.

    -Safai


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