Windows 98 problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • billsahiker@yahoo.com

    #1

    Windows 98 problem

    Why is my application crashing on a windows 98 machine? It runs fine
    on the development machine with xp pro. I installed framework 2, with
    dotnetfx.exe, and windows installer 2 on the windows 98 machine. I
    read here that dotnetfx does not have all of the framework. could that
    be the problem?

    Some of the functions work, others do not.
    The ones that do not have one thing in common: they make an
    asynchronous call to a method in a class library in the same VB
    solution.I resesearched this topic in this group
    and checked out the methods at msdn which indicates they are
    supported on windows 98. What makes things interesting is that I added
    two message boxes to see how far the code gets. The app crashes after
    the first two message boxes, but before the third, and before reaching
    the sub that makes the async call.

    Private Sub btnQuickQuoteOK _Click(ByVal sender As System.Object,
    ByVal e As System.EventArg s) Handles btnQuickQuoteOK .Click
    If Trim(txtQuickQu oteSymbol.Text) = "" Then
    MsgBox("A symbol is required.") 'this works
    Exit Sub
    End If
    If InStr(txtQuickQ uoteSymbol.Text , ",") 0 Then
    MsgBox("One Symbol only") 'this works
    Exit Sub
    End If
    'Me.Cursor = Cursors.WaitCur sor 'commented out to rule this
    one out.
    MsgBox("calling ClearQuickQuote ") 'added for debugging -
    crashes before this point.
    ClearQuickQuote ()
    MsgBox("calling getquotes") 'added for debugging
    GetQuotes(Split (Trim(txtQuickQ uoteSymbol.Text ), ",")) 'makes
    asynchronous call
    'Me.Cursor = Cursors.Default
    End Sub

    Private Sub ClearQuickQuote ()
    txtLast.Text = ""
    txtDayHi.Text = ""
    txtDayLo.Text = ""
    txtOpen.Text = ""
    txtClose.Text = ""

    End Sub

    Private Sub GetQuotes(ByVal Symbols() As String)
    ' Create an instance of the test class.
    Dim ad As New Async()
    ' Create the delegate.
    Try
    Dim caller As New AsyncMethodCall er(AddressOf
    ad.GetQuotes)
    ' Initiate the asynchronous call
    Dim result As IAsyncResult = caller.BeginInv oke(Symbols,
    AddressOf CallbackMethod, _
    caller)
    Catch ex As Exception
    MsgBox(ex.Messa ge)
    End Try
    End Sub
    ' Callback method must have the same signature as the
    ' AsyncCallback delegate.
    Sub CallbackMethod( ByVal ar As IAsyncResult)
    Dim returnValue As String = ""
    ' Retrieve the delegate.
    Try
    Dim caller As AsyncMethodCall er = CType(ar.AsyncS tate,
    AsyncMethodCall er)

    ' Call EndInvoke to retrieve the results.
    returnValue = caller.EndInvok e(ar)
    Catch ex As Exception
    MsgBox(ex.Messa ge)
    End Try

    'need to implement a thread-safe way to reference a control on
    the form to avoid a
    'cross-thread access error.
    SetData(returnV alue)

    End Sub
    Private Sub SetData(ByVal HtmlString As String)
    ' InvokeRequired required compares the thread ID of the
    ' calling thread to the thread ID of the creating thread.
    ' If these threads are different, it returns true.
    Try
    If Me.WebBrowser1. InvokeRequired Then
    Dim d As New SetTextCallback (AddressOf SetData)
    Me.Invoke(d, New Object() {HtmlString})
    Else
    If BusTier.Buslaye r.QuickQuote Then
    FillQuickQuote( HtmlString)
    Else
    Me.WebBrowser1. DocumentText = HtmlString
    End If
    End If
    Catch ex As Exception
    Exit Sub
    End Try

    End Sub

  • Chris Dunaway

    #2
    Re: Windows 98 problem

    On May 11, 9:54 am, billsahi...@yah oo.com wrote:
    supported on windows 98. What makes things interesting is that I added
    two message boxes to see how far the code gets. The app crashes after
    the first two message boxes, but before the third, and before reaching
    the sub that makes the async call.
    >
    Private Sub btnQuickQuoteOK _Click(ByVal sender As System.Object,
    ByVal e As System.EventArg s) Handles btnQuickQuoteOK .Click
    If Trim(txtQuickQu oteSymbol.Text) = "" Then
    MsgBox("A symbol is required.") 'this works
    Exit Sub
    End If
    If InStr(txtQuickQ uoteSymbol.Text , ",") 0 Then
    MsgBox("One Symbol only") 'this works
    Exit Sub
    End If
    'Me.Cursor = Cursors.WaitCur sor 'commented out to rule this
    one out.
    MsgBox("calling ClearQuickQuote ") 'added for debugging -
    crashes before this point.
    ClearQuickQuote ()
    MsgBox("calling getquotes") 'added for debugging
    GetQuotes(Split (Trim(txtQuickQ uoteSymbol.Text ), ",")) 'makes
    asynchronous call
    'Me.Cursor = Cursors.Default
    End Sub
    >
    Why don't you enclose the code above in a try catch block and then
    post the exception that is being generated. That would help determine
    what is going on.

    Chris

    Comment

    • billsahiker@yahoo.com

      #3
      Re: Windows 98 problem

      Adding the try/catch blocks did not catch the error. The app crashes
      with the following message:"Applic ation has generated an exception
      that could not be handled." It then gives the process and thread IDs.
      This is the same message I was getting previously. Any ideas?
      >
      Why don't you enclose the code above in a try catch block and then
      post the exception that is being generated. That would help determine
      what is going on.
      >
      Chris- Hide quoted text -
      >
      - Show quoted text -

      Comment

      • Michael D. Ober

        #4
        Re: Windows 98 problem

        If this is a windows forms app, create a app wide error handler and catch
        the error there. Also, have you tried this on a different Win98 system
        (preferably on that has just been built starting with a format)? The reason
        I ask is that Win98 is highly suseptable to corruption.

        Mike.

        <billsahiker@ya hoo.comwrote in message
        news:1178905382 .083593.281880@ e65g2000hsc.goo glegroups.com.. .
        Adding the try/catch blocks did not catch the error. The app crashes
        with the following message:"Applic ation has generated an exception
        that could not be handled." It then gives the process and thread IDs.
        This is the same message I was getting previously. Any ideas?
        >>
        >Why don't you enclose the code above in a try catch block and then
        >post the exception that is being generated. That would help determine
        >what is going on.
        >>
        >Chris- Hide quoted text -
        >>
        >- Show quoted text -
        >
        >

        Comment

        • billsahiker@yahoo.com

          #5
          Re: Windows 98 problem

          I have put try/catch blocks on everything and the error is still not
          handled. I think there is a method I am calling that is not supported
          on win98 and when that happens the CLR has no ability to catch the
          error. It is an old machine, but runs other .net 2 apps, tho they are
          very simple. Others have posted on this group with same error message
          when their app crashes. This is the only win98 machine I have access
          to.

          On May 11, 1:45 pm, "Michael D. Ober" <obermd.@.alum. mit.edu.nospam>
          wrote:
          If this is a windows forms app, create a app wide error handler and catch
          the error there. Also, have you tried this on a different Win98 system
          (preferably on that has just been built starting with a format)? The reason
          I ask is that Win98 is highly suseptable to corruption.
          >
          Mike.
          >
          <billsahi...@ya hoo.comwrote in message
          >
          news:1178905382 .083593.281880@ e65g2000hsc.goo glegroups.com.. .
          >
          >
          >
          Adding the try/catch blocks did not catch the error. The app crashes
          with the following message:"Applic ation has generated an exception
          that could not be handled." It then gives the process and thread IDs.
          This is the same message I was getting previously. Any ideas?
          >
          Why don't you enclose the code above in a try catch block and then
          post the exception that is being generated. That would help determine
          what is going on.
          >
          Chris- Hide quoted text -
          >
          - Show quoted text -- Hide quoted text -
          >
          - Show quoted text -

          Comment

          Working...