Thank you Mark. I will look at the .h file for more details as you suggested. 
However if you can elaborate a little bit more at a high level as how to pass a 
COM objects between host application and scripts, that would be of great help. 
Also, I am wondering if there's sample code doing stuff like that?

Thanks,
Hung.



----- Original Message ----
From: Mark Hammond <mhamm...@skippinet.com.au>
To: Hung Nguyen <hwn...@yahoo.com>
Cc: Python-Win32 List <python-win32@python.org>
Sent: Tue, November 17, 2009 6:13:23 PM
Subject: Re: [python-win32] Passing data to/from Python script

On 18/11/2009 1:05 PM, Hung Nguyen wrote:
> Hi Mark,
>
> To clarify the requirement:
>
> 1) The application is a C++, COM application that has CPython embeded in it.
>
> 2) There are some data elements, let say COM objects, in the application's 
> process space
>
> 3) The application invoke a Python script that runs on the Python engine
>
> 4) The script needs to be able to operate upon the above COM objects, e.g. 
> calling methods in the interfaces exposed by the COM objects.
>
> 5) The script needs to be able to instantiate COM objects and somehow pass 
> them back to the application.

You are likely to need to link to (or load dynamically) some of the 
entry-points in pythoncomxx.dll - you will find functions for converting 
to and from COM objects via IDispatch etc pointers.  For non COM objects 
you just use the CPython API.  See pythoncom.h for more details...

HTH,

Mark

>
> Please let me know if you need further information.
>
> Thanks,
> Hung.
>
>
>
> ----- Original Message ----
> From: Mark Hammond<skippy.hamm...@gmail.com>
> To: Hung Nguyen<hwn...@yahoo.com>
> Cc: Python-Win32 List<python-win32@python.org>
> Sent: Tue, November 17, 2009 5:50:21 PM
> Subject: Re: [python-win32] Passing data to/from Python script
>
> On 18/11/2009 8:48 AM, Hung Nguyen wrote:
>> I am working on an application that has Python embeded into it to run
>> Python scripts. Using the Python for Windows extension, what is the best
>> way to pass data, potentially COM objects, back and forth between the
>> host application and the scripts.
>
> "Pass them as parameters?"  Otherwise, you need to give more detail about the 
> environment before I can answer more meaningfully.
>
> Cheers,
>
> Mark.
>
>
>
>

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to