DDE Client on another computer cannot ddemlclienttransaction to DDE Server

R

Raymond Chiu

Dear all,

Now I am writting the DDE Server and DDE Client. I used the sample NDde from
the web site: http://ndde.codeplex.com/.

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

-----------------------------------On
Connecting -------------------------------------------------------
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());
}

-----------------------------On Some
Action ---------------------------------------

Moreover,

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);
 
R

rchiuhk

I have found that my computer does not contain nddeagnt.exe file. Is it the
reason??
As I find in the web that this file needed to start conversation between
client and server in the network dde.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top