Results 1 to 8 of 8

Thread: ActiveX Exe - RunTime Error 462

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    5

    ActiveX Exe - RunTime Error 462

    Good Afternoon,

    Problem:

    Standard EXE - uses ActiveX Exe as a class error handler

    If I kill (simulating an ActixeX Exe crash) the ActiveX Exe process thereby eliminating the ability of my Standard Exe to handle errors, how can I:

    1. Restart the ActiveX Exe without restarting the main standard Exe?
    2. Trap the error (#462) so I can start a different process or perhaps handle the error in another manner?

    Thank you for your assistance.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You need to trap the origin of the error in the ActiveX Exe so that it doesn't get muddled up. Maybe add some generic error handling for unexpected errors.

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    5

    How will that work?

    Thank you for your reply.

    I am not sure how I can create a generic error handler within the ActiveX Exe since that process will no longer exist anyway.

    In addition, the error handler I have in the Standard Exe apparently will not recognize the error until it attempts to call either a Property Set or Public Function (Method) and at that point generates a run-time error vs allowing me to supersede that error and test for it.

    How can I test for the existence of the ActiveX Exe process prior to calling it?

    How can I restart the process if stopped/killed without restarting the Standard Exe?

    Thank you for your help.

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    See what I believe is happening is an unhandled error is happening in the ActiveX exe which causes it to close. As a result the next call to a property or method in the activeX exe from the calling standard exe causes the error you are getting. Either that or the error could be coming directly from the activeX exe, have you tested for this? To stop/restart the activeX exe you'd probably have to set the object to nothing and create a new instance from within your standard exe. It still may go bugger on you though. You could also try testing to see if the activex exe is nothing before calling the property and/or methods, but I'm not sure it sets itself to nothing with an error.

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    5
    Actually, the ActiveX Exe is not failing at all at this point. I am manually killing the process through Task Manager to simulate a crash.

    It is my intention to prevent this problem should the need arise.

    However; your point about testing for nothing is an interesting one, and I will try that shortly. If I can determine it does not exist first before calling it, then I can re-instantiate it and move forward.

    Thank you.

  6. #6

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    5
    Unfortunately, testing for nothing did not help.

    Even though the actual process is not running, it was never set to "Nothing" therefore; my question is returned with "False."

    The problem also lies with the error happening during the error handling routine. Here is a snippet (the problem occurs when I attempted to set a property, NOT when using the WITH statement):

    Code:
    'Some code to handle an event causes an error
    
    
    ErrorHandler:
    
        'Set Error Parameters
            With ErrClass
                .ErrorNumber = Err.Number
                .ErrorDescription = Err.Description
                .ModuleName = "frmVirtualKeyboard"
                .ProcedureName = "cmdKeys_Click(" & Index & ") - Character: " & Index
            End With        'ErrClass
    
        'Process Error
            Select Case ErrClass.fProcessError
                Case 0
                    Resume
                Case 1
                    Resume Next
                Case 2
                    'Close Form
                        Call CloseForm(Me)
                Case 3
                    'Close Application
                        Call CloseApplication
            End Select      'ErrClass.fProcessError
    Last edited by MusicMan; Aug 9th, 2002 at 05:50 PM.

  7. #7
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Where is the error popping up? Also I guess it is good to be prepared but what would cause your activeX exe to crash but not your app (other than someone using the task manager)?

    Hmm I can see the pickle of trapping on error of an error handler...

    Maybe somethign like this:
    VB Code:
    1. Private Sub Handler(Desc As String)
    2.     On Error GoTo AhhHa
    3.    
    4.     'handle error hear
    5.     Dim x
    6.     'sim activex error
    7.     x = 1 / 0
    8.     Exit Sub
    9. AhhHa:
    10.     MsgBox Desc
    11. End Sub
    12.  
    13. Private Sub Command1_Click()
    14.     On Error GoTo Err1
    15.     Dim x
    16.     'cause error
    17.     x = 1 / 0
    18.  
    19.     Exit Sub
    20. Err1:
    21.     'store err info in something else that is safe
    22.     Dim errStr As String
    23.     errStr = Err.Description
    24.    
    25.     'call method so you can trap another error
    26.     Handler errStr
    27. End Sub

    Have the error info stored in something safe and passed to a general method that way it resets the error handling and you can catch the error on the activex object.

  8. #8

    Thread Starter
    New Member
    Join Date
    Aug 2002
    Posts
    5
    Thank you.

    I was contemplating that option earlier, but did not implement it. I would think there would be a method in which I could check the "running status" of a process - although if I dig deep enough into the WinAPI's I could find one.

    Your suggestion is probably the best method, basically a "wrapper" for lack of a better term.

    As to why the ActiveX Exe would crash and not the Standard Exe, couldn't tell ya', just trying to be prepared - or maybe over prepared.

    Thanks for the info and help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width