Re: Displaying an MFC COM object using comtypes

"Tom Galvin" <[email protected]>
Newsgroups gmane.comp.python.windows-ce
Message-ID <C9D19A363862284F9FA316375A3638CB4C90A3@mercury.internal.geminidataloggers.com>
I have been having difficulties calling an MFC dll from python and found
this post useful.

http://groups.google.com/group/microsoft.public.windowsce.platbuilder/ms
g/8c38be02059bb286?dmode=source





-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of [email protected]
Sent: 28 March 2006 11:00
To: [email protected]
Subject: PythonCE Digest, Vol 32, Issue 14

Send PythonCE mailing list submissions to
	[email protected]

To subscribe or unsubscribe via the World Wide Web, visit
	http://mail.python.org/mailman/listinfo/pythonce
or, via email, send a message with subject or body 'help' to
	[email protected]

You can reach the person managing the list at
	[email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of PythonCE digest..."


Today's Topics:

   1. Displaying an MFC COM object using comtypes (Aladin Sidahmed)


----------------------------------------------------------------------

Message: 1
Date: Mon, 27 Mar 2006 15:05:47 -0700
From: "Aladin Sidahmed" <[email protected]>
Subject: [PythonCE] Displaying an MFC COM object using comtypes
To: <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://mail.python.org/pipermail/pythonce/attachments/20060327/42b531eb/
attachment-0001.html 

------------------------------

_______________________________________________
PythonCE mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pythonce


End of PythonCE Digest, Vol 32, Issue 14
****************************************

____________________

Important Notice:

This email and any attachments are confidential and may contain trade secrets or be legally privileged. If you have received this email in error you must not use, rely upon, disclose, copy or distribute the contents. Please reply to the sender so that proper delivery can be arranged and delete the email from your computer.
Gemini Data Loggers monitor incoming and outgoing email to ensure satisfactory customer service, maintain company security and prevent abuse of their email system. However, any views expressed in this email are not necessarily those of Gemini and Gemini cannot be held responsible for the content.
Gemini makes best efforts to ensure emails are virus free; however you are advised to carry out your own checks. Gemini does not accept responsibility for any damage resulting from email viruses.
____________________
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.