[python-win32] Creating python com objects

Alex Denham a1eio at hotmail.com
Thu Apr 24 13:03:33 CEST 2008


ah thanks very much, initially i had a unique GUID however i got giddy and excited when i found 'PyIDropTarget' in one of the modules, unfortunatly it was just an id (i thought it was an object)
I'm working my way through python programming on win32, do you know of any other material i can work through? because i'm just lacking when it comes to this. A good example being, i had no idea i had to specify the IID interface!

Thanks for your help so far, much appreciated.
Alex

> From: rwupole at msn.com
> To: python-win32 at python.org
> Date: Thu, 24 Apr 2008 06:52:30 -0400
> Subject: [python-win32]  Creating python com objects
> 
> Alex Denham wrote:
> 
> class PyIDropTarget:
>     _public_methods_ = ['DragEnter', 'DragOver', 'DragLeave', 'Drop']
>     _reg_progid_ = "Python.PyIDropTarget"
>     _reg_clsid_ = '{00000122-0000-0000-C000-000000000046}'
>     def DragEnter(self, args=None):
>         print 'DragEnter: ', args
>     def DragOver(self, args=None):
>         print 'DragOver: ', args
>     def DragLeave(self, args=None):
>         print 'DragLeave: ', args
>     def Drop(self, args=None):
>         print 'Drop: ', args
> 
> Your class also needs to specify the IID of the interface it
> implements, eg
>     _com_interfaces_=[pythoncom.IID_IDropTarget]
> 
> Also, the _reg_clsid_ should be a unique GUID that you
> generate yourself to identify your own implementation of
> IDropTarget, rather than the system GUID for IDropTarget.
> 
>         Roger
> 
> 
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32

_________________________________________________________________
Search and win with BigSnapSearch.com 
http://www.bigsnapsearch.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20080424/ebfaf214/attachment.htm>


More information about the python-win32 mailing list