Sam Trenholme's webpage
This article was posted to the Usenet group alt.hackers in 1995; any technical information is probably outdated.

Windows DDE hack


Article: 8838 of alt.hackers
From: tkennedy@cyberport.com (Warren Young)
Newsgroups: alt.hackers
Subject: Windows DDE hack
Date: Thu, 12 Oct 1995 05:43:52 GMT
Organization: Kennedy and Associates
Lines: 40
Approved: bill@b-picayune.com
Message-ID: 45ia1u$crd@macaw.cyberport.com
NNTP-Posting-Host: ppp22.cyberport.com
X-Newsreader: Forte Free Agent 1.0.82
Status: RO

First, someone else's hack: Go look at http://abacab.mac.trincoll.edu.
Good stuff.

Next, my ObHack:

Windows' API has an excuse for interprocess communication called DDE.
Aside from being overly complex (it would be easier to open a TCP/IP
link to localhost through Winsock than to use DDE), it can only send
strings.  Or rather, you have to send messages as Windows "atoms",
which are null-terminated entities.  So, if you want to send binary
data to another program, tough....if you're one to give up easily,
that is B-).

Well, I naturally needed to send binary data between two programs, and
the data was likely to contain nulls.  The easy way out would have
been to sprintf() the data to a string and then sscanf() it on the
other end, but that was inefficient.  And easy.

So, I reasoned, how do you send binary data over ASCII links?
uuencode!  So, I wrote a quick uuencode variant and sent the data that
way.

Next hack: Write a C++ wrapper class for DDE that makes it as easy to
use as the aforementioned TCP/IP connection.  Naturally, it will
support automatic uu{en,de}coding.

For what it's worth, I've switched from WinVN to Free Agent, and found
out that you can't post here from Free Agent using the trick I used
with WinVN.  Thanks to another hacker's message here for cluing me
about the method.  I like the WinVN method better, though -- I think
it has more hack value.

Warren


------
GCS/TW: -d+(---) H- s+:+ g+ p2 au a- w+>++ v-(?) C++$ UL++(V$) P+>+++
    L+>++ 3 E>+++ N+>++ K+ w++>+++ M-(+) V-- -po+ Y+ t+ !5 j+ R+ G?
    tv b+++(++) D+(++) B-- e*(+) u*>** h+ f r-- n---- !y




Back to index