app as an object name
-
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
-
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
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
-
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
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]
-
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]
-
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
kmoorevs wrote:
Anyone see how this might cause random crashes?
No, certainly a variable name won't cause that.
-
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
-
kmoorevs wrote:
Anyone see how this might cause random crashes?
No, certainly a variable name won't cause that.
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
-
Did they try rebooting/reinstalling previous version first? Maybe the file was corrupted.
"You get that on the big jobs."
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
-
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
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.
-
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.
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