Groups | Blog | Home
all groups > dotnet remoting > july 2006 >

dotnet remoting : Bi-Directional Remoting with Unmanaged App


victor
7/28/2006 4:14:28 PM

Hello,
I'm facing the following difficulty with a Remoting app which
communicates with an Unmanaged (VC6) app in a two-way manner.
I have done the direction from Framework to VC6 through WIN32-API
delegates, using FindWindow + PostMessage. This works fine.

But now I have to go the other way back: from the VC6 app to the
Framework, also by using PostMessage. What I have in mind is: create a
second remoting path with the Server at the Framework machine and let
its client run on the VC6 machine.
My problem is the following: how must I implement the WIN32
WindowProc(UINT msg, WPARAM wparam, LPARAM lparam) on my Framework
machine (in order to receive the PostMessage data)?
In other words, how must I create such a WIN32 method under C#?
Anybody have a code snippet as example?

Thankyou very much!
Victor.
Simon
7/30/2006 5:46:22 PM
Build a mixing-mode managed C++ DLL to wrap your C# code and to export
native C++ classes, your VC6 code can load and use it as VC6 DLL. You don't
need any PostMessage or WindowProc.

Good luck,

Simon Lu

[quoted text, click to view]

Günter Prossliner
7/31/2006 12:21:45 PM
Hi Victor!

[quoted text, click to view]

This method is not called "Remoting" within the .Net Framework. The term
"Remoting" is used for the "Cross App Domain" marshaling of Objects (see
System.Runtime.Remoting Namespace).

[quoted text, click to view]

You cannot.

But it is possible to implement the WinProc by using managed code. You just
have to derive a class from System.Windows.Forms.Form (this is usually done
be the forms designer), and override the method "WndProc".


OK?
br GP

AddThis Social Bookmark Button