Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. app as an object name

app as an object name

Scheduled Pinned Locked Moved The Weird and The Wonderful
loungesaleshelpquestion
10 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kmoorevs
    wrote on last edited by
    #1

    One of our legacy reporting applications written in VB6 and using Crystal Reports recently started experiencing random crashes on the customer end when opening reports. The problem never occured in the development environment, or in any of the test environments we use. As mentioned, crashes were random, and were happening regardless of the report. This is what I found in the General Declarations of the Reports form:

    Dim app As CRAXDRT.Application

    Why is this even possible?. I changed it to

    Dim CRApp As CRAXDRT.Application

    and replaced where needed...problem resolved. Anyone see how this might cause random crashes?

    "Go forth into the source" - Neal Morse

    E P R A 4 Replies Last reply
    0
    • K kmoorevs

      One of our legacy reporting applications written in VB6 and using Crystal Reports recently started experiencing random crashes on the customer end when opening reports. The problem never occured in the development environment, or in any of the test environments we use. As mentioned, crashes were random, and were happening regardless of the report. This is what I found in the General Declarations of the Reports form:

      Dim app As CRAXDRT.Application

      Why is this even possible?. I changed it to

      Dim CRApp As CRAXDRT.Application

      and replaced where needed...problem resolved. Anyone see how this might cause random crashes?

      "Go forth into the source" - Neal Morse

      E Offline
      E Offline
      ekolis
      wrote on last edited by
      #2

      Perhaps there was a global variable called "app" already, and declaring another "app" variable at form level was causing code in the form that was trying to reference the global variable to reference the local one instead? Or maybe your app is just crap! :P

      C 1 Reply Last reply
      0
      • E ekolis

        Perhaps there was a global variable called "app" already, and declaring another "app" variable at form level was causing code in the form that was trying to reference the global variable to reference the local one instead? Or maybe your app is just crap! :P

        C Offline
        C Offline
        Chris Meech
        wrote on last edited by
        #3

        Well he did say it was using Crystal Reports already. :cool:

        Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

        K 1 Reply Last reply
        0
        • C Chris Meech

          Well he did say it was using Crystal Reports already. :cool:

          Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra] posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]

          K Offline
          K Offline
          kmoorevs
          wrote on last edited by
          #4

          Which I why I called it CRApp! Self-documenting code!

          "Go forth into the source" - Neal Morse

          1 Reply Last reply
          0
          • K kmoorevs

            One of our legacy reporting applications written in VB6 and using Crystal Reports recently started experiencing random crashes on the customer end when opening reports. The problem never occured in the development environment, or in any of the test environments we use. As mentioned, crashes were random, and were happening regardless of the report. This is what I found in the General Declarations of the Reports form:

            Dim app As CRAXDRT.Application

            Why is this even possible?. I changed it to

            Dim CRApp As CRAXDRT.Application

            and replaced where needed...problem resolved. Anyone see how this might cause random crashes?

            "Go forth into the source" - Neal Morse

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            kmoorevs wrote:

            Anyone see how this might cause random crashes?

            No, certainly a variable name won't cause that.

            K 1 Reply Last reply
            0
            • K kmoorevs

              One of our legacy reporting applications written in VB6 and using Crystal Reports recently started experiencing random crashes on the customer end when opening reports. The problem never occured in the development environment, or in any of the test environments we use. As mentioned, crashes were random, and were happening regardless of the report. This is what I found in the General Declarations of the Reports form:

              Dim app As CRAXDRT.Application

              Why is this even possible?. I changed it to

              Dim CRApp As CRAXDRT.Application

              and replaced where needed...problem resolved. Anyone see how this might cause random crashes?

              "Go forth into the source" - Neal Morse

              R Offline
              R Offline
              RobCroll
              wrote on last edited by
              #6

              Did they try rebooting/reinstalling previous version first? Maybe the file was corrupted.

              "You get that on the big jobs."

              K 1 Reply Last reply
              0
              • P PIEBALDconsult

                kmoorevs wrote:

                Anyone see how this might cause random crashes?

                No, certainly a variable name won't cause that.

                K Offline
                K Offline
                kmoorevs
                wrote on last edited by
                #7

                You are correct. One of the affected customers is running a new version with the object renamed. Due to the randomness of it, it appeared to have solved the problem, however, the problem has resurfaced. I'm actually glad the variable/object name was not the culprit...it would've violated scope as I understand it. Luckily, in the last build, I put in a simple trace log so that I now know the method causing the fault. (I can see exactly where CRApp is CRApping out!) Still, there are some variable names (like app) that one should avoid.

                "Go forth into the source" - Neal Morse

                1 Reply Last reply
                0
                • R RobCroll

                  Did they try rebooting/reinstalling previous version first? Maybe the file was corrupted.

                  "You get that on the big jobs."

                  K Offline
                  K Offline
                  kmoorevs
                  wrote on last edited by
                  #8

                  Tried that a long while back, but the problem persists...changing the variable name was not the answer. Starting to smell like dll hell, but even that puzzles me, since it seems so random. Anyway, I know this is the wrong forum for troubleshooting. Thanks

                  "Go forth into the source" - Neal Morse

                  1 Reply Last reply
                  0
                  • K kmoorevs

                    One of our legacy reporting applications written in VB6 and using Crystal Reports recently started experiencing random crashes on the customer end when opening reports. The problem never occured in the development environment, or in any of the test environments we use. As mentioned, crashes were random, and were happening regardless of the report. This is what I found in the General Declarations of the Reports form:

                    Dim app As CRAXDRT.Application

                    Why is this even possible?. I changed it to

                    Dim CRApp As CRAXDRT.Application

                    and replaced where needed...problem resolved. Anyone see how this might cause random crashes?

                    "Go forth into the source" - Neal Morse

                    A Offline
                    A Offline
                    alcexhim
                    wrote on last edited by
                    #9

                    Way, way back when I first started programming in VB6 (about eight years ago, haven't touched it since!) I seem to recall there was a global variable that VB6 defined as "App" Examples: App.PrevInstance, App.Title, App.HelpFile It's possible that, somewhere without even knowing it, your application was referring to a variable on the VB6 App object (which wouldn't exist in your redefinition of the app variable, remember VB6 is case insensitive). Being a .NET developer today, the fact that your app was done in VB6 is one thing that clued me in on this issue: the global App variable does not exist in VB.NET.

                    K 1 Reply Last reply
                    0
                    • A alcexhim

                      Way, way back when I first started programming in VB6 (about eight years ago, haven't touched it since!) I seem to recall there was a global variable that VB6 defined as "App" Examples: App.PrevInstance, App.Title, App.HelpFile It's possible that, somewhere without even knowing it, your application was referring to a variable on the VB6 App object (which wouldn't exist in your redefinition of the app variable, remember VB6 is case insensitive). Being a .NET developer today, the fact that your app was done in VB6 is one thing that clued me in on this issue: the global App variable does not exist in VB.NET.

                      K Offline
                      K Offline
                      kmoorevs
                      wrote on last edited by
                      #10

                      Exactly! (and thanks for posting!) I was wondering how I could even declare app as a Crystal Report Application object to begin with. Turns out it works fine and was not the cause of our problems. The problem was corrected by using late binding on the Crystal App object.

                      "Go forth into the source" - Neal Morse

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups