The Design and Implementation of the WebGIS system posted yesterday did not implement the final map rendering, because of the problem of COM interaction. After reading the edison1024 message and MapX implementation, I found that there was a problem with my design. I tried to use mapservice to create a mapengine, then, create a form and render the map in mapengine. In this way, if it is a. Net class or a com-based non-visual DLL, there should be no problem. But for ActiveX, there is a problem.
According to the implementation of MapX in edison1024, another form object is created using the host that creates the remoting service, and then its mapengine object (pointing to a specific form) is called in mapengine:
Public Shared Mapengine As Frmsupermapform
< Stathread () > Shared Sub main () 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
The running result is as follows: