Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is Object running
Message
From
10/12/2001 16:51:37
 
 
To
10/12/2001 15:58:37
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00592094
Message ID:
00592404
Views:
13
>Thanks for the help, but I am still not getting what I am looking for. I might be going about it the wrong way. Here is what I am doing.
>
>Dim oMapApp as Object
>
>' Is MapPoint Open or has oMapApp been assigned
>If VarType(oMapApp.Visible) = VariantType.Boolean 'Gives me an error
>End If
>
>If VarType(oMapApp) = VariantType.Object 'Returns True
> ' The above statement returns true because I dimmed it as an object, but
> ' I was hoping it would return false, since I haven't created the object
> ' yet. In FoxPro I would say - VARTYPE("oMapApp.Visible") = "L" - and
> ' if MapPoint was not created I was in business. What am I missing in
> ' VB, because it seems to be the same in VB.NET.
>Else
> oMapApp = CreateObject("MapPoint.Application")
>End If
>
>Thanks again for the help.
>
>Randy Belcher

Try this (although I don't recall if variants made it through VB.Net):
Dim oMapApp As Variant
If IsEmpty(oMapApp) Then
  'var has not been initialized
Else
  'variant can be checked with VarType() or TypeOf
End If
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform