This project is read-only.

Your sample cannot work on remote computer

Oct 16, 2009 at 8:34 AM

I have downloaded your sample and change client code to work on another computer.

When DDE Server and DDe Client are not on the same computer, they does not work even after setting DDEShare in the DDE Server.

How come!!!!

Oct 16, 2009 at 6:26 PM

I have found something after debuging ddeclient when ddeclient is on another computer.

In DdemlClient.cs, e.g. TryRequest(), problem in the line: function call Ddeml.DdeClientTransaction

IntPtr dataHandle = Ddeml.DdeClientTransaction(
                IntPtr.Zero,
                0,
                _ConversationHandle,   // this has value before, after run this line, it becomes zero. And then dataHandle is also zero. No problem when server and client are in the same computer.
                itemHandle,
                format,
                Ddeml.XTYP_REQUEST,
                timeout,
                ref returnFlags);

Oct 16, 2009 at 6:49 PM

Moreover, I find that on connecting to the server on another computer, The Line:
// Establish a conversation with a server that suppoerts the service name and topic name pair.
                    IntPtr handle = Ddeml.DdeConnect(instanceId, serviceHandle, topicHandle, IntPtr.Zero);
in connect function of conversationmanager class in DdemlClient.cs

When running this line, the server should prompt the connection messages as it should trigger the below sub in the server, but it don't :
protected override bool OnBeforeConnect(string topic)
            {
                Console.WriteLine("OnBeforeConnect:".PadRight(16)
                    + " Service='" + base.Service + "'"
                    + " Topic='" + topic + "'");

                return true;
            }

            protected override void OnAfterConnect(DdeConversation conversation)
            {
                Console.WriteLine("OnAfterConnect:".PadRight(16)
                    + " Service='" + conversation.Service + "'"
                    + " Topic='" + conversation.Topic + "'"
                    + " Handle=" + conversation.Handle.ToString());
            }