I have run into a problem on a users system which is very annoying. I have
a code which uses VB for the user interface, and MB to do the work in
MapInfo. The error occurs while I am establishing the 'connection' between
VB and MapBasic. My code goes as follows:
Public objMapInfo As Object
Public mbApp As Object
Public globinfo As Object
Sub Main
Set objMapInfo = GetObject(, "MapInfo.Application")
objMapInfo.Do "Run Application """ & App.Path & "\dattomap.mbx"""
>>> Set mbApp = objMapInfo.MBApplications.Item("dattomap.mbx")
Set globinfo = mbApp.MBGlobals
My error occurs on the Set mbApp statement. I have the error trapped and
have put a timer on the error in case the mbx hasn't had time to execute.
My error trap allows about 60 seconds to pass which should be more then
enough time for the mbx to basically open and go into a wait state due to
the remote message handler in the code.
I have noted the number of mbapplications (msgbox
objMapInfo.MBApplications.count) and it reports the correct # of mb apps.
When I attempt to note the names of the MBApplications(msgbox
objMapInfo.MBApplications.Item(1).Name ), the code fails.
The VB error I keep getting is (-2147417851) which is basically saying 'the
server threw an exception'.
This code works fine on 90% of my users systems. This error is occuring on
a WinNT system where MI is local and the other mb applications run on a
server.
Any thoughts or comments would be appreciated as I am out of guesses on this
one.
Thanks,
Greg Toothaker
POWERmap Europe Product Manager
Resource Data International, Inc.
a Financial Times Energy company
[EMAIL PROTECTED]
http://www.POWERmap.com
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]