Emmanuel,

Thanks for your code.

My thoughts are this:  I have a vb on error routine which sets mapinfo to
nothing if needed.  I also have an object which is set to
mapinfo.mbapplications.  This .mbx has a remotemsghandler to which I pass
strings and accomplish tasks that are too complex for mapinfo.do.

If the MapBasic program encounters an error, it is directed to an onerror
routine which creates a log file and then ends.  But this causes the vb
program to crash because it has lost the connection with the .mbx object
without first going to its on error routine to set mapinfo to nothing.  I
have found while the .mbx may have crashed that the vb mapinfo object may
still exist and takes me to the problem of terminating this object at the
next run.

Carol
        -----Original Message-----
        From:   Emmanuel Par� [SMTP:[EMAIL PROTECTED]]
        Sent:   Monday, May 17, 1999 4:34 PM
        To:     Sheehan, Carol; [EMAIL PROTECTED]
        Subject:        Re: MI Closing MapInfo OLE object

        Just set the object to nothing
        ex:

        Public Sub ShutdownMapInfoConnection()

        '* first, if the MapInfo object exists, we must reset its callback
object
        '* to a null object ( the VB keyword "Nothing" ), otherwise the VB
app will
        '* not exit because the reference count on this object will still be
greater
        '* than 0.
            If Not (MapInfo Is Nothing) Then
                MapInfo.SetCallback Nothing
            End If

        'Set la valeur de l'objet Mapinfo a nothing
            Set MapInfo = Nothing

        End Sub


        -----Original Message-----
        From: Sheehan, Carol <[EMAIL PROTECTED]>
        To: '[EMAIL PROTECTED]' <[EMAIL PROTECTED]>
        Date: 14 mai, 1999 15:09
        Subject: MI Closing MapInfo OLE object


        >Hello,
        >
        >I'm wondering if anyone has some vb code which closes a MapInfo OLE
object
        >which was created during a previous run and then crashed.  The
MapInfo
        >object still is present in the task manager process list after the
        >application has terminated abnormally and I want to shut it down
the next
        >time the application starts.
        >
        >GetObject doesn't access these type of objects.  I'm having some
trouble
        >getting a handle for a process which is no longer active and that
does not
        >have a window associated with it.  I can create a new MapInfo
object with
        >CreateObject but first I want to terminate the previous inactive
object if
        >it exists.
        >
        >Thanks,
        >
        >Carol Sheehan
        
>----------------------------------------------------------------------
        >To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and
put
        >"unsubscribe MAPINFO-L" in the message body, or contact
[EMAIL PROTECTED]
        >
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to