I am attempting to connect to DDE applications via C#. I have successfully written the code that imports the method, in addition, I have successfully launched the application, I have however been unsuccessful in connecting to it via DDE. I have included my code below, does anyone have any suggestions?
If feel I should note that I have debugged the code and I have noticed that sPtr, tPtr, and channel all include a value of 0 after their line of code is executed.
private static extern IntPtr DdeConnect(uint idInst, IntPtr hszService, IntPtr hszTopic, IntPtr pCC);
private static extern IntPtr DdeCreateStringHandle(uint idInst, string psz, int iCodePage);
// This code is in a method
uint instId = 0;
IntPtr sPtr = DdeCreateStringHandle(instId, "iexplore", 1004);
IntPtr tPtr = DdeCreateStringHandle(instId, "www_openurl", 1004);
Process application = new Process();
application.StartInfo.FileName = @"C:\Program Files\Internet Explorer\iexplore.exe";
IntPtr channel = DdeConnect(instId, sPtr, tPtr, (IntPtr)null);