ActiveX Control

Anonymous
09-03-2002, 09:17 PM
Ok, I have a VB project with several forms that have the mappoint activex control embedded on them... problem is that it's not guaranteed that the users of my app will have mappoint installed on the pc... I know that I can determine if mappoint is installed by looking in the registry but that doesn't help the fact that if it's not installed then I will get a run time error cause the object is on serveral forms...

Any ideas of how to get around this?

John Meyer
09-04-2002, 05:28 AM
Do your check for mappoint either in a splash screen or sub main.

Eric Frost
09-04-2002, 04:07 PM
Can you add or remove the control from the forms at run-time?

John Meyer
09-04-2002, 05:44 PM
Sure, this code will add the MapPoint control to form1. (You still need to have the Control added to your project.)

'General Declarations Section
Dim WithEvents MPC As MappointControl

Private Sub Command1_Click()

Set MPC = Controls.Add("Mappoint.Control.9", "MappointControl1", Form1)

MPC.Move 1, 1, Form1.Width - 100, Form1.Height - 100
MPC.Visible = True
Set objMap = MPC.NewMap(geoMapNorthAmerica)

End Sub

 
Web mp2kmag.com
mapforums.com