按照edison1024的MapX的实现,使用创建Remoting服务的Host创建了另一个窗体对象,然后在MapEngine里去调用他的MapEngine对象(指向具体的窗体),就可以了:
Public Shared MapEngine As frmSuperMapForm
<STAThread()> Shared Sub Main()
Dim chan1 As TcpChannel
chan1 = New TcpChannel(8085)
ChannelServices.RegisterChannel(chan1)
RemotingConfiguration.RegisterWellKnownServiceType(GetType(MapService), "MapService", WellKnownObjectMode.Singleton)
MapEngine = New frmSuperMapForm
Application.Run(MapEngine)
End Sub
<STAThread()> Shared Sub Main()
Dim chan1 As TcpChannel
chan1 = New TcpChannel(8085)
ChannelServices.RegisterChannel(chan1)
RemotingConfiguration.RegisterWellKnownServiceType(GetType(MapService), "MapService", WellKnownObjectMode.Singleton)
MapEngine = New frmSuperMapForm
Application.Run(MapEngine)
End Sub
运行结果如下: