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

    AfxLockTempMaps ?

    Could someone tell me what AfxLockTempMaps / AfxUnlockTempMaps functions are / do?


  2. #2
    Join Date
    Jul 1999
    Posts
    13

    Re: AfxLockTempMaps ?

    This function lock(unlock) temporary maps, which
    created when you call CWnd::FromHandle for example.

    So, when application go idle, temporary maps are deleted. To defend you temporary pointers from destroying you must call AfxLockTempMap, then, after you program will made need calculations call AfxUnlockTempMap to allow system to free
    memory alocated to temporary objects. I think so,
    but I can mistake and no test how it work. And don't know from where I've got this information.
    I think the debugger tell me this

    Example:

    void CClass::OnHideMe( hWnd )
    {
    static CWnd* pWnd = CWnd::FromHandle( hWnd )
    pWnd->ShowWindow( SW_HIDE );
    // after quit this function temporary
    // object, created by CWnd::FromHandle
    // will be destroyed and next call to this
    // function will fail
    }





    Eugene


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