I have a vb 6 app that uses mappoint. How do I check to see if there is mappoint installed on a system so the app doesn't crash if the user doesn't have mappoint installed.
This is a discussion on How do I check to see if there is mappoint installed on a sy within the MapPoint Desktop Discussion forums, part of the Map Forums category; I have a vb 6 app that uses mappoint. How do I check to see if there is mappoint installed ...
I have a vb 6 app that uses mappoint. How do I check to see if there is mappoint installed on a system so the app doesn't crash if the user doesn't have mappoint installed.
Hmmm, I thought I'd replied to this yesterday but it doesn't seem to have appeared.
Can you get at the Registry?
Another way might be to attempt to create a MapPoint.Application object, and trap it for an exception. This is how I'd be tempted to do it in C++. Does VB have exception handling, or somekind of error return?
Richard
Winwaed Software Technology LLC
http://www.winwaed.com
See http://www.mapping-tools.com for MapPoint Tools
you could probably use a try stream. Something lilke
Thats how I'd do it in VB.net though I think VB6 has try things tooCode:try create mappoint object catch(ex as exception) msgbox("Mappoint not installed") end try
M
I do it like this.
'//Check for properly installed mappoint
Dim rk As RegistryKey
rk = Registry.CurrentUser
rk = rk.OpenSubKey("Software\Microsoft\MapPoint")
'//If properly installed
If Not rk Is Nothing Then
'Me.WindowState = FormWindowState.Minimized
Map = New frmMap
Map.Show()
Else
'//If NOT properly installed
MsgBox("Mapping feature only works if you have mappoint installed" & vbCrLf & _
"If Mappoint is installed on the machine, please run it once, before accessing this feature", _
MsgBoxStyle.Critical, "Mappoint error")
End If
Best Regards.
Bug
Microsoft Certified Solutions Developer
There are currently 1 users browsing this thread. (0 members and 1 guests)