First the sample code:
static HWND hwndClientDDE;
static HWND hwndServerDDE;
//ADDITIONAL VARIABLES DECLARED HERE...........
lgval=::SendMessage((HWND) -1, // broadcasts message WM_DDE_INITIATE, //initiates conversation (WPARAM) hwndClientDDE, //handle of client DDE
MAKELONG(atomApplication, // application-name atom atomTopic)); //topic-name atom
//Code to delete atom here................
atomItem = GlobalAddAtom(szItemName);
PackDDElParam(WM_DDE_REQUEST, CF_TEXT, atomItem));
This is pretty much out of MSDN, I am using VC 1.0 (can you believe it!). I want to hook to an Excel spreadsheet. The above SendMessage returns a 1, but then it broadcasts to all active windows so I'm not totally convinced. The PostMessage comes back as 0 and the PackDDElParam is not recognized at all in the compiling(so I tried it with MAKELONG, taking out the WM_DDE_REQUEST - and got the 0). Does anybody know why this doesn't work????