C# and DDE

  • Thread starter Thread starter guy
  • Start date Start date
G

guy

Is there an example somewhere of using C# with DDE. I have an ancient
application that is a DDE server and would like to get some live info from
it in a C# app. I need an example of C# as a DDE client not server.

Thanks.
 
guy,

Since DDE is dependent on windows messages, all you really have to do is
define the SendMessage API function, and call that with the appropriate
parameters, marshaling the parameters you want to send in the correct
manner.

You just have to find the window handle (probably through FindWindow),
and then you are set.

Hope this helps.
 
Hi Nicholas,

I've worked with DDE in both C and C++ in older versions of Microsoft C and
Visual C or whatever they called it then. They then came out with DDEML
which helped a bit. However, I'm having real problems trying to find any
corresponding structure in C# so still not sure where to turn. I'm also a
bit confused as to why I'm struggling with this in C# because it was/is such
a simple concept in C/C++.

I'll keep hunting. Thanks for the help.
Guy

Nicholas Paldino said:
guy,

Since DDE is dependent on windows messages, all you really have to do
is define the SendMessage API function, and call that with the appropriate
parameters, marshaling the parameters you want to send in the correct
manner.

You just have to find the window handle (probably through FindWindow),
and then you are set.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

guy said:
Is there an example somewhere of using C# with DDE. I have an ancient
application that is a DDE server and would like to get some live info
from it in a C# app. I need an example of C# as a DDE client not server.

Thanks.
 
Back
Top