For me, the ShellExecute part works, i.e. a testfile gets opened, but the subsequent connect fails:
hszApp = DdeCreateStringHandle(idInst, szApp, 0);
hszTopic = DdeCreateStringHandle(idInst, szTopic, 0);
hConv = DdeConnect(idInst, hszApp, hszTopic, NULL);
DdeFreeStringHandle(idInst, hszApp);
DdeFreeStringHandle(idInst, hszTopic);
if (hConv == NULL)
{
printf("DDE Connection Failed.\n");
printf("Paras: idInst=%i\nhszApp=%p\nhszTopic=%p\n", idInst, hszApp, hszTopic);
Sleep(1500); DdeUninitialize(idInst);
return 0;
}
DDE Connection Failed.
Paras: idInst=16777344
hszApp=0000c000
hszTopic=0000c001
hszApp and hszTopic look like valid handles.
However, when I change the second line to ...
hszTopic = DdeCreateStringHandle(idInst, "System", 0);
... the connection stands.