Getting Python to show ATL & MFC Dialogs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • solid.snake.84@hotmail.com

    #1

    Getting Python to show ATL & MFC Dialogs

    In my ATL Class, I have a function with the body

    STDMETHODIMP CSimpleObj::Sho w()
    {
    AFX_MANAGE_STAT E(AfxGetStaticM oduleState())

    // TODO: Add your implementation code here
    CSimpleDialog myDialog;
    int result = myDialog.DoModa l();
    MessageBox(NULL ,TEXT("Live From Python"),
    TEXT("MFC ATL COM"), MB_OK);
    return S_OK;
    }

    and python script is very simple

    from comtypes.client import CreateObject
    MFC = CreateObject("M FCATLCom.Simple Obj.1")
    MFC.Show( )

    if does return a success message, but niether the Dialog nor the
    Message box appears. Does any one know what's going on?

Working...