[PythonCE] Displaying an MFC COM object using comtypes

Tom Galvin TGalvin at geminidataloggers.com
Wed Mar 29 13:16:24 CEST 2006


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: pythonce-bounces at python.org [mailto:pythonce-bounces at python.org]
On Behalf Of pythonce-request at python.org
Sent: 28 March 2006 11:00
To: pythonce at python.org
Subject: PythonCE Digest, Vol 32, Issue 14

Send PythonCE mailing list submissions to
	pythonce at python.org

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
	pythonce-request at python.org

You can reach the person managing the list at
	pythonce-owner at python.org

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" <aladin at junipersys.com>
Subject: [PythonCE] Displaying an MFC COM object using comtypes
To: <pythonce at python.org>
Message-ID: <000b01c651ea$9a63d9b0$3900a8c0 at jsihome.com>
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
PythonCE at python.org
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.
____________________



More information about the PythonCE mailing list