MapPoint Control created dynamically

gkelly
11-11-2002, 01:39 PM
the following fails

dim mp as MappointControl

set mp = CreateObject( "MapPoint.Control 0.9" )
error: ActiveX component can't create object

set mp = CreateObject( "MapPoint.Control" )
error: Type Mismatch

Is there a way to create a Mappoint object without placing it on a form?

John Meyer
11-12-2002, 08:48 AM
If you don't need the ActiveX Control on the form why not just use Automation?

Most of the samples in the help file are using that method, not the MapPoint ActiveX Control.

Consider this sample from the help file: "OpenMap method (Application)"

Sub OpenSampleMap()

Dim objApp As New MapPoint.Application

'Set up application
objApp.Visible = True
objApp.UserControl = True

'Open a sample map
objApp.OpenMap objApp.Path + "\Samples\Clients.ptm"

End Sub

If you don't need to see the map to do what you are doing, set the objApp.Visible = False

 
Web mp2kmag.com
mapforums.com