Set oCourier = Server.CreateObject("MapInfo.MapXCourier")
Set oMapX = oCourier.GetMapXFromNewServer( "world.gst" )
If (oMapX Is Nothing) Then
Response.Write "Could not create MapX object"
Exit Do
End If
Response.Write "OK"
结果为OK。Set oMapX = oCourier.GetMapXFromNewServer( "world.gst" )
If (oMapX Is Nothing) Then
Response.Write "Could not create MapX object"
Exit Do
End If
Response.Write "OK"
用C#的WinForm形式,代码如下:
MapXcourier mc = new MapXcourierClass();
object map = mc.GetMapXFromNewServer("world.gst");
if(map == null)
{
MessageBox.Show(mc.GetErrorDesc()+"\n"+mc.GetErrorFuncName());
}
else
{
MessageBox.Show("OK");
}
结果也是OK。object map = mc.GetMapXFromNewServer("world.gst");
if(map == null)
{
MessageBox.Show(mc.GetErrorDesc()+"\n"+mc.GetErrorFuncName());
}
else
{
MessageBox.Show("OK");
}
但是同样的代码在Asp.net页面中不正确:
MapXcourier mc = new MapXcourierClass();
object map = mc.GetMapXFromNewServer("world.gst");
if(map == null)
{
Response.Write(mc.GetErrorDesc()+"<br >"+mc.GetErrorFuncName());
}
else
{
Response.Write("OK");
}
结果map==null。object map = mc.GetMapXFromNewServer("world.gst");
if(map == null)
{
Response.Write(mc.GetErrorDesc()+"<br >"+mc.GetErrorFuncName());
}
else
{
Response.Write("OK");
}
该如何调用才能在网页中正确调用?