[python-win32] Sending raw bytes with DDE server

Dave Cook daverz at gmail.com
Mon Oct 28 21:47:16 CET 2013


On Mon, Oct 28, 2013 at 10:56 AM, Tim Roberts <timr at probo.com> wrote:

>
> You're sure the client wants binary, and not some ASCII encoding of the
> binary?  That was a common strategy in the days when DDE was popular
> (that is, during the reign of the 80386).
>
> Your assessment is correct.  The PyWin32 DDE support is string only.  If
> you really need binary, then you will have to write a DLL helper.  The
> ctypes module might help.
>

Thanks, guys.

I do have he original C code for the DDE server, so if I have to I can wrap
that.  Here is where it creates the return value for the request.

                        hddedata = DdeCreateDataHandle( g_service.dwIdInst,
                                                        (LPBYTE)&status,
                                                        sizeof(
REMOTESTATUS ) + 1,
                                                        0,
                                                        hszItem,
                                                        CF_TEXT,
                                                        0 );

Where REMOTESTATUS is the data struct and hddedata is of type HDDEDATA.
CF_TEXT is the clipboard format.  So it seems that what I need to do is
encode the data into clipboard format.

Dave Cook
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20131028/c2fec35b/attachment.html>


More information about the python-win32 mailing list