You'd need to study up on .NET Remoting... even if both exe's are on the same
machine. I think- if I understood your post correctly- that this is what
you're looking for. It's not difficult and it allows your exe to behave
similarly to a good ol' COM ActiveX EXE Server...
In the server EXE's Sub Main you'd do something like:
Dim TCPChannel As TcpChannel = New TcpChannel(49175) 'can be any port you want
ChannelServices.RegisterChannel(TCPChannel)
RemotingConfiguration.RegisterWellKnownServiceType(GetType(<YOURCLASS>),
"<SOME_NAME_TO_IDENTIFY_THIS_CONNECTION>", WellKnownObjectMode.SingleCall)
In the client you'd do something like this to call the exe:
Dim o As YOURCLASS = CType(Activator.GetObject(GetType(YOURCLASS),
"tcp://localhost:49175/<SOME_NAME_TO_IDENTIFY_THE_CONNECTION"), YOURCLASS)
'now use it like any ol' object
x = o.DoSomething()
Your class needs to inherit from MarshalByRef... and any types it returns
need to be serializable (most types are... but some aren't).
Also, there's the "gotcha" that the client needs to "know" what the class
is... so it needs to have a local reference to the server class. This defeats
the purpose of remoting because then you need a COPY of the server class on
the client even though it's actually executing somewhere else.... sooooo, the
easy solution is for YOURCLASS to imlement an Interface defined in a "shim"
dll that both client and server can share. The lightweight dll (containing
Interface definitions only) would then accomplish the same exact thing as a
Type Library (.tlb) in ol' COM or WSDL file in Web Services.
More info: check out:
http://msdn.microsoft.com/architect...l=/library/en-us/dnnetsec/html/SecNetHT15.asp