[python-win32] How to create a com_record?
patter001 at gmail.com
Tue Mar 11 17:58:35 CET 2008
Old thread, but I got a little more data on the function. The function
actually has a REFIID as the first parameter. This apparently is a standard
structure for C COM code. I'm not entirely sure why the win32com changes
the REFIID to be a VT_RECORD. Does the following definition of the functions
help at all (they are from the IDL file)
HRESULT GetInterface( [in] REFIID riid, [out, retval, iid_is(riid)]
should be same as:
HRESULT GetInterface( [in] GUID* pGuid, [out, retval, iid_is(pGuid)]
On Mon, Feb 4, 2008 at 6:44 PM, Mark Hammond <mhammond at skippinet.com.au>
> > guid = win32com.client.Record("GUID", some_ob)
> > I don't have the some_obj that allows me to build "GUID".
> It should be any object from the same typelib - almost certainly whatever
> object you intend passing this record to.
> > VB.NET (GetType) and C++ (__uuid) both already know that a GUID is a
> C++ doesn't know it is a COM record. A COM record is something quite
> different to a C/C++ struct or from .NET types. A COM record is
> specifically designed to be cross-language.
> > It seems the python CLSID is the same thing, but i don't know what to
> > to get a CLSID that is a com_record type.
> As I've explained, we are looking for the COM record definition you are
> trying to use. A C++ struct definition for a GUID is *not* what you are
> looking for - you are looking for the COM record definition of a GUID. I
> see now that you simply copied me a C++ struct you found, which is not at
> all useful in this context.
> To clarify: in a *typelib* you will find a struct definition that you are
> trying to use. Finding a struct definition of the same name somewhere
> is not suitable.
> > Am I understanding the win32com.client.Record call correctly? It needs
> GUID to be defined by the
> > COM right?
> Not "defined by COM", but "defined using COM" - the author of a typelib
> have defined it somewhere.
> > Its odd b/c the GIUD (python's CLSID) is all over the COM definitions
> just type
> > VT_RECORD type that I'm not understanding how to convert to.
> Yes, I'm afraid you are confused. All existing GUID or CLSID definitions
> you can find are useless - there is only 1 that is relevant, and that will
> be defined in a typelib.
> I think the confusion is such that you need to find basic docs for the
> object, so we can get back to square 1.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the python-win32