Getting Python to show ATL & MFC Dialogs

S

solid.snake.84

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

STDMETHODIMP CSimpleObj::Show()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState())

// TODO: Add your implementation code here
CSimpleDialog myDialog;
int result = myDialog.DoModal();
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("MFCATLCom.SimpleObj.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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top