Python and COM?

Toby Dickenson htrd90 at zepler.org
Mon Jul 12 17:49:44 EDT 1999


Bill Tutt <billtut at microsoft.com> wrote:

(posted an cc'ed to bill)

>(As an added bonus, this should actually work)
>The only GUID from interp.py is the coclass one. Every other GUID was just
>generated.

I _think_ the python code would also need to be changed to allow
QueryInterface for the IID of that dispinterface.

>Hope the below helps.... The MIDL docs in MSDN are certainly less than
>useful. :(

Hmmm, yes. Ive checked on MSDN but can't find anything authoritative
on this, either way.

>// System idl include nonsense
>import "oaidl.idl";
>import "ocidl.idl";
>
>[
>	uuid(EB048AA4-C2D1-11d2-855D-00C04F797DBA),
>	helpstring("Python.Interepreter dispinterface")
>]
>dispinterface IPythonInterpreter
>{ properties: 
>methods:
>	[id(1)] HRESULT Eval([in] BSTR bstrExpression, [out, retval] VARIANT
>pvarReturnValue);
>	[id(2)] HRESULT Exec([in] BSTR bstrExpression);
>};
>
>[
>	uuid(60240FE4-C2D2-11d2-855D-00C04F797DBA),
>	version(1.0),
>	helpstring("Python.Interpreter Type Library")
>]
>library PythonInterpreterLib
>{
>	importlib("stdole32.tlb");
>	importlib("stdole2.tlb");
>
>	[
>		uuid(30BD3490-2632-11cf-AD5B-524153480001),
>		helpstring("Python.Interpreter COClass")
>	]
>	coclass PythonInterpreter
>	{
>		[default] dispinterface IPythonInterpreter;
>	};
>
>}


Toby Dickenson




More information about the Python-list mailing list