Displaying an MFC COM object using comtypes

"Aladin Sidahmed" <[email protected]>
Newsgroups gmane.comp.python.windows-ce
Message-ID <[email protected]>
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?

-Aladin

*BTW Thanks to Luke Dunstan for helping me out  with getting PythonCE and comtypes running.

_______________________________________________
PythonCE mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pythonce
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.