Dynamic copy/paste using DDE with Python on Windows

Eric Brunel eric.brunel at pragmadev.com
Wed Oct 16 06:05:11 EDT 2002


Peter Hansen wrote:

> Eric Brunel wrote:
>> Hi all,
>> 
>> We'd like to add to a Windows application the possibility to make dynamic
>> copy/paste: the user selects something in the application, pastes it
>> elsewhere (e.g. Word...), and whenever the source is modified, the
>> changes are automatically forwarded to the copy.
>> 
>> AFAIK, the way to do that on Windows is DDE. But I can't find anywhere a
>> simple sample code showing how to do that.
> 
> I thought DDE was *way* deprecated by now, and long since replaced
> by OLE, then OLE2 or something, then COM, then ActiveX, and probably
> by now something else...

Thanks a lot, Peter. This is actually what we understood from various 
sources. Apparently, the "hip" thing for now is ActiveX components, a.k.a. 
OLE objects via COM (if I understood correctly...).

So my question now becomes: has anyone succeeded in making linkable OLE 
objects with Python? I understood that to be able to do that, one has to 
create a COM object implementing the IOleObject and (for example) the 
IDataObject interfaces. But I've no idea on how to actually implement the 
required methods in these objects. Did anybody succeeded to do that? May I 
get sample code or pointers to usable documentation? Again, searching the 
docs, newsgroups or web didn't return anything usable (if anything at 
all)...

> Also, as far as I recall DDE was always broken in a number of,
> uh, "interesting" ways and probably not worth your time trying
> to get it working.  Maybe someone else will point out that
> I'm wrong about that...

Apparently, doing a DDE-style copy/paste link does not work anymore with 
recent versions of applications. So DDE is definitely a dead-end. Thanks 
again anyway.
-- 
- Eric Brunel <eric.brunel at pragmadev.com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com



More information about the Python-list mailing list