+ Reply to Thread
Results 1 to 2 of 2

Thread: What is AFX_MANAGE_STATE?

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    49

    What is AFX_MANAGE_STATE?

    Hi All,

    What is AFX_MANAGE_STATE?

    When to use it?

    Thanks.

  2. #2
    When you are building a MFC DLL that displays some GUI object like a Dialog box then you should use this MACRO.

    MFC Application has its own resource instance. When you load DLL and display dialog box from DLL then it should loads its own resources from DLL.

    This requires switching.

    AFX_MANAGE_STATE does this.

    So in every exported procedure, write the bellow line as first line:

    Code:
    void MyExportedFunction()
    {
          AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
       
          //do your code here...
    }

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

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