Unexpected Error!!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • D & J G

    #1

    Unexpected Error!!

    A VB6 program that I created has been installed on a wide range of computers
    and networks without any problems. Win 95, Win 98 and XP so far..
    Occasionally, however, the function refuses to start on some systems, with
    the only response being a critical error: 'Unexpected Error!', without even
    trying to run.

    Well! I didn't expect it, either!

    Re-compiling and re-installing doesn't change anything. The program is
    nothing really special. Reading, modifying and rewriting files is all it
    does and all the files it needs to read are pre-written during install..

    Does anyone have any idea what sort of problems commonly produce such a
    message? Is the range of suspects far too great to even guess? Why does
    it start OK on most computers but refuses on one or two?

    Frustrating!!! A meaningful error message would help.

    Don


  • Dean Earley

    #2
    Re: Unexpected Error!!

    D & J G wrote:[color=blue]
    > A VB6 program that I created has been installed on a wide range of computers
    > and networks without any problems. Win 95, Win 98 and XP so far..
    > Occasionally, however, the function refuses to start on some systems, with
    > the only response being a critical error: 'Unexpected Error!', without even
    > trying to run.
    >
    > Well! I didn't expect it, either![/color]

    I suggest you put some logging in your code to see how far it gets if
    anywhere.
    Does it ever run on a machine its failed on?
    Are you using any custom controls?

    --
    Dean Earley (dean.earley@ic ode.co.uk)
    i-Catcher Development Team

    iCode Systems

    Comment

    • D & J G

      #3
      Re: Unexpected Error!!

      ** Responses interspersed..

      "Dean Earley" <dean.earley@ic ode.co.uk> wrote in message
      news:440d99bc$0 $20850$da0feed9 @news.zen.co.uk ...[color=blue]
      >D & J G wrote:[color=green]
      >> A VB6 program that I created has been installed on a wide range of
      >> computers and networks without any problems. Win 95, Win 98 and XP so
      >> far.. Occasionally, however, the function refuses to start on some
      >> systems, with the only response being a critical error: 'Unexpected
      >> Error!', without even trying to run.
      >>
      >> Well! I didn't expect it, either![/color]
      >
      > I suggest you put some logging in your code to see how far it gets if
      > anywhere.[/color]

      ** Not sure how to do this. I'm somewhat a newbie :O(
      [color=blue]
      > Does it ever run on a machine its failed on?[/color]

      ** No. Refuses to start.
      [color=blue]
      > Are you using any custom controls?[/color]

      ** No

      ** Thanks for your input.
      [color=blue]
      >
      > --
      > Dean Earley (dean.earley@ic ode.co.uk)
      > i-Catcher Development Team
      >
      > iCode Systems[/color]


      Comment

      • Dean Earley

        #4
        Re: Unexpected Error!!

        D & J G wrote:[color=blue]
        > ** Responses interspersed..
        >
        > "Dean Earley" <dean.earley@ic ode.co.uk> wrote in message
        > news:440d99bc$0 $20850$da0feed9 @news.zen.co.uk ...[color=green]
        >> D & J G wrote:[color=darkred]
        >>> A VB6 program that I created has been installed on a wide range of
        >>> computers and networks without any problems. Win 95, Win 98 and XP so
        >>> far.. Occasionally, however, the function refuses to start on some
        >>> systems, with the only response being a critical error: 'Unexpected
        >>> Error!', without even trying to run.
        >>>
        >>> Well! I didn't expect it, either![/color]
        >> I suggest you put some logging in your code to see how far it gets if
        >> anywhere.[/color]
        >
        > ** Not sure how to do this. I'm somewhat a newbie :O([/color]

        Either open a file for append and "print" to it, or msgboxes in key
        places in the code.

        --
        Dean Earley (dean.earley@ic ode.co.uk)
        i-Catcher Development Team

        iCode Systems

        Comment

        • Steve Gerrard

          #5
          Re: Unexpected Error!!


          "D & J G" <donandjane@opt usnet.com.au> wrote in message
          news:440abf40$0 $1143$afc38c87@ news.optusnet.c om.au...[color=blue]
          >A VB6 program that I created has been installed on a wide range of computers
          >and networks without any problems. Win 95, Win 98 and XP so far..
          >Occasionally , however, the function refuses to start on some systems, with the
          >only response being a critical error: 'Unexpected Error!', without even trying
          >to run.
          >
          > Well! I didn't expect it, either!
          >
          > Re-compiling and re-installing doesn't change anything. The program is
          > nothing really special. Reading, modifying and rewriting files is all it does
          > and all the files it needs to read are pre-written during install..
          >
          > Does anyone have any idea what sort of problems commonly produce such a
          > message? Is the range of suspects far too great to even guess? Why does it
          > start OK on most computers but refuses on one or two?
          >[/color]

          No two computers are exactly alike. Stuff happens. If it's weird, don't ask the
          why question :)

          Some things you might check:

          Which OS does it sometimes fail on? (I'm guessing XP...)
          Where did you put those files "pre-written during install"? (I'm guessing
          Program Files...)
          Did you run a setup for the program? Look at the list of files in the setup
          (setup.lst). Is every one of those files on the pesky machine? Is each one at
          least as new as the version in your setup? Are your "pre-written" files present?

          One possible scenario is that while many XP users are set up as machine
          administrators, you have encountered someone who is not. They may be denied
          permission to install some dlls, or may not have read/write permissions on files
          located in Program Files. If your program tries something very early in startup
          that is denied, the program might not be perceived by the OS to have even loaded
          up and started, hence the "unexpected " error. The most common cause is probably
          file permissions.


          Comment

          • Raoul Watson

            #6
            Re: Unexpected Error!!


            "D & J G" <donandjane@opt usnet.com.au> wrote in message
            news:440e7f61$0 $1013$afc38c87@ news.optusnet.c om.au...[color=blue]
            > ** Responses interspersed..[color=green]
            > > ...
            > > I suggest you put some logging in your code to see how far it gets if
            > > anywhere.[/color]
            >
            > ** Not sure how to do this. I'm somewhat a newbie :O([/color]

            You can create a sub such as..

            Sub myDebug(mystr$)
            dim f$
            f$ = App.Path & "\debug.txt "
            Open f$ for append as # 1
            print #1, mystr$
            Close
            End Sub


            And call this routine to write out "markers where you're at in the program.
            For example

            Call myDebug("In sub MAIN getting preferences")
            Call myDebug("Gettin g user network ID..")

            Reading user settings..
            etc.. etc..

            Examining the file will give you an idea how far you get and where the
            program may have issues..


            Comment

            • D & J G

              #7
              Re: Unexpected Error!!


              "Raoul Watson" <WatsonR@Intell igenCIA.com> wrote in message
              news:tLbQf.1967 1$6h1.18785@trn dny09...[color=blue]
              >
              > "D & J G" <donandjane@opt usnet.com.au> wrote in message
              > news:440e7f61$0 $1013$afc38c87@ news.optusnet.c om.au...[color=green]
              >> ** Responses interspersed..[color=darkred]
              >> > ...
              >> > I suggest you put some logging in your code to see how far it gets if
              >> > anywhere.[/color]
              >>
              >> ** Not sure how to do this. I'm somewhat a newbie :O([/color]
              >
              > You can create a sub such as..
              >
              > Sub myDebug(mystr$)
              > dim f$
              > f$ = App.Path & "\debug.txt "
              > Open f$ for append as # 1
              > print #1, mystr$
              > Close
              > End Sub
              >
              >
              > And call this routine to write out "markers where you're at in the
              > program.
              > For example
              >
              > Call myDebug("In sub MAIN getting preferences")
              > Call myDebug("Gettin g user network ID..")
              >
              > Reading user settings..
              > etc.. etc..
              >
              > Examining the file will give you an idea how far you get and where the
              > program may have issues..
              >[/color]
              When running, as soon as the code gets to
              myDebug
              I get the message

              Compile Error:
              "Argument not optional"

              Huh! Am I too green for this?
              Don


              Comment

              • Raoul Watson

                #8
                Re: Unexpected Error!!


                "D & J G" <donandjane@opt usnet.com.au> wrote in message
                news:44128b0c$0 $14239$afc38c87 @news.optusnet. com.au...[color=blue]
                >[/color]
                [color=blue]
                > When running, as soon as the code gets to
                > myDebug
                > I get the message
                >
                > Compile Error:
                > "Argument not optional"
                >[/color]

                the routine expect a string to be passed. If you omit it, you will get an
                error.
                If you use a variable, make sure the variable is declared as a string, e.g

                Dim mystr as String
                ....
                mystr = "Getting user network ID."
                call myDebug(mystr)

                if not, you'll get a byref argument type mismatch. test out the routine by
                itself
                Just create a form with a button:

                Private Sub Command1_Click( )
                Dim mystr As String
                mystr = "Cmd 1 Pressed"
                Call myDebug(mystr)
                End Sub

                Sub myDebug(mystr$)
                Dim f$
                f$ = App.Path & "\debug.txt "
                Open f$ For Append As #1
                Print #1, mystr$
                Close
                End Sub


                Comment

                • D & J G

                  #9
                  Re: Unexpected Error!!


                  "Raoul Watson" <WatsonR@Intell igenCIA.com> wrote in message
                  news:%IzQf.3$Vb .2@trndny01...[color=blue]
                  >
                  > "D & J G" <donandjane@opt usnet.com.au> wrote in message
                  > news:44128b0c$0 $14239$afc38c87 @news.optusnet. com.au...[color=green]
                  >>[/color]
                  >[color=green]
                  >> When running, as soon as the code gets to
                  >> myDebug
                  >> I get the message
                  >>
                  >> Compile Error:
                  >> "Argument not optional"
                  >>[/color]
                  >
                  > the routine expect a string to be passed. If you omit it, you will get an
                  > error.
                  > If you use a variable, make sure the variable is declared as a string, e.g
                  >
                  > Dim mystr as String
                  > ...
                  > mystr = "Getting user network ID."
                  > call myDebug(mystr)
                  >
                  > if not, you'll get a byref argument type mismatch. test out the routine by
                  > itself
                  > Just create a form with a button:
                  >
                  > Private Sub Command1_Click( )
                  > Dim mystr As String
                  > mystr = "Cmd 1 Pressed"
                  > Call myDebug(mystr)
                  > End Sub
                  >
                  > Sub myDebug(mystr$)
                  > Dim f$
                  > f$ = App.Path & "\debug.txt "
                  > Open f$ For Append As #1
                  > Print #1, mystr$
                  > Close
                  > End Sub
                  >[/color]
                  Thank you so much, Raoul. How dumb I feel! All was OK except that I hadn't
                  declared the variable (Duh).

                  All is well now. Just have to test it in my program.

                  Don


                  Comment

                  Working...