Getting DDEML To Work With Remoting - Please, Please, Please Help

Getting DDEML To Work With Remoting - Please, Please, Please Help

Post by TmVkZHlSb2 » Wed, 14 Sep 2005 05:14:05


This post was placed in the Dotnet.framework.interop. I think it should have
been placed here. It should not be posted in two places. Sorry about that.

I have a class wrapped around some of the DDEML API functions. Normally, I
can instantiate this class and use it's method to return a value from a DDE
Server. This works great. Now what I really want to do is set this up to work
with the remoting framework. Please note the following steps I did:

1) Made the class wrapper remotable by inheriting from MarshalByRefObject

2) Set up a test remoting server application in Singleton mode with a
registered channel and the registered remotable class.

3) Set up a remoting client with a registered channel and the registered
remotable class.

Both the client application and the server application are on the same
machine for test purposes. When I instantiate the class from the client
application and call the method to retrieve a value from the DDE Server, the
application appears to hang and I do not get any value back. In steping
through the code in debug mode, I know that the remotable class is
instantiated with it's property values set correctly (I have property values
for Service, Topic, Name and Value). Where it hangs is when the DdeConnect
API call is made. This API call uses a callback function which is setup in
the same class. The callback function appears to get correctly initialized in
the DdeInitialize API call.

I'm new to DDEML and to remoting. Any help would be appreciated.

Thanks
 
 
 

Getting DDEML To Work With Remoting - Please, Please, Please Help

Post by Brian Gide » Wed, 14 Sep 2005 08:50:01

Based only on what you've mentioned there are some things that jump out
at me. The DDEML is thread specific. That means all calls to the
DDEML must be from the same thread that called DdeInitialize.
Furthermore, they must also execute on a thread with a message loop.
Unless you have created your own message loop thread from within the
remotable object that all DDEML calls are made on then you're going to
have problems.

Regardless, I'm not sure why DdeConnect would hang. I would have
expected it to return an error code or something. How long does it
hang? Can you provide some of the code? The functions where the DDEML
calls are made will probably be fine for now.

Have you explored other options besides DDE? DDE is old and hard to
work with.

If DDE is your only option then you can try the following class library
to get DDE to work in .NET. It uses the DDEML and the entire source
code is provided.

< http://www.yqcomputer.com/ ;

Brian