|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Error from Hell: OverflowMy VB6 (SP6) app produces an Overflow error and bombs. I use Win XP (Sp2). 1) Program has Option Explicit. So every variable is typed. 2) Program works fine on one computer, but not on another! 3) Error is intermittent. 4) Sometimes it overflows even on VB timer function. I am using a dll that was created from another program. In the calling statement, there are 13 output arguments (x1,y1,z1,...) defined as Variant. They are arrays with no priory knowledge of their size. And there are several input arguments (in1,in2...) typed as double. Dim b as variant Dim x1 as variant Dim y1 as variant ....... call subroutine(13, b,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4,in1,in2,in3,in4,...) These arrays used to plot a 3D graph: with Graph3D for i=1 to ubound(a1,1) PlotXYZ x1(i,1),y1(i,1),z1(i,1),0 next for i=1 to ubound(a1,1) PlotXYZ x2(i,1),y2(i,1),z2(i,1),1 next for i=1 to ubound(a1,1) PlotXYZ x3(i,1),y3(i,1),z3(i,1),2 next for i=1 to ubound(a1,1) PlotXYZ x4(i,1),y4(i,1),z4(i,1),3 next .autorange end with I believe the overflow is caused by somewhere in these for loops. If I remove the last two or three loops it goes away! What the hell is going on? Is there a way to detect/trap overflow? I run MS code advisor, it is useless. Any help greatly be appreciated. Please help. Cem
Show quote
Hide quote
"Athena" <gi***@comcast.net> wrote in message You're not serious about passing ALL of those parameters are you? No wonder news:uFoTCbq1FHA.3660@TK2MSFTNGP15.phx.gbl... > Hi, > > My VB6 (SP6) app produces an Overflow error and bombs. I use Win XP > (Sp2). > > 1) Program has Option Explicit. So every variable is typed. > 2) Program works fine on one computer, but not on another! > 3) Error is intermittent. > 4) Sometimes it overflows even on VB timer function. > > I am using a dll that was created from another program. In the calling > statement, there are 13 output arguments (x1,y1,z1,...) defined as > Variant. They are arrays with no priory knowledge of their size. And there > are several input arguments (in1,in2...) typed as double. > > Dim b as variant > Dim x1 as variant > Dim y1 as variant > ...... > > call subroutine(13, > b,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4,in1,in2,in3,in4,...) you're having problems. After seeing that, I'm not even going to venture into looking at the rest of your code. Assuming I counted correctly....18 parameters (and apparently even more)!?!?!?!? <MAJOR shudder> No offense intended (maybe you're not the author of that procedure), but anyone that worked for me and wrote a procedure like that would be gone within a week (and I just hope that I wasn't the fool that hired him/her). > Is there a way to detect/trap overflow? I run MS code advisor, it is It's a trappable error. It's error number is 6. You just need to write an > useless. Any help greatly be appreciated. Please help. error handler for it. I don't see how that's going to help you, though. My head's still spinning from passing 18+ parameters! <g> -- Mike Microsoft MVP Visual Basic Mike,
What I want is to plot a pointcloud data in 3D. Different parts of the data is to have different colors. I should be able to rotate the plot by using mouse. For this I have to write a piece of code either in DirectX or OpenGL. Since I am not a professional programmer such as yourself, my solution was to find a nice dll (NTGraph3d)and plot for x,y and z sets (12 variables) using this dll. Do you know a VB code that would plot >50000 data points in less than 1s and capable of rotating the plot? I would be happy to use it right away. Otherwise I am stuck with this "overflow" error. Do you know how to find the origin of an overflow error? In my case not only it is intermitent, but it pops up from different parts of the program. This is what I want to find out from MVP's such as you. Athena *** Sent via Developersdex http://www.developersdex.com *** First, ditch the variants. Those are nothing but trouble. I would use
either a Long or Double, depending on how big the number is (look up both in the documentation to determine this for yourself). Next, I have to agree with Mike...passing all those arguments is just plain bad. Instead, why not use properties for each variable. This way you can set them as needed and get them in your subroutine, instead of passing them. it would make your life incredibly easier. This is about all I can suggest with the info you have provided. It would help to know specifically which line you are experiencing the error, and what the values of your variables are at the time of the error. - Kev Show quoteHide quote "Athena" <Ath***@devdex.com> wrote in message news:ek8Ot6q1FHA.3204@TK2MSFTNGP14.phx.gbl... > > Mike, > > What I want is to plot a pointcloud data in 3D. Different parts of > the data is to have different colors. I should be able to rotate the > plot by using mouse. For this I have to write a piece of code either in > DirectX or OpenGL. Since I am not a professional programmer such as > yourself, my solution was to find a nice dll (NTGraph3d)and plot for x,y > and z sets (12 variables) using this dll. Do you know a VB code that > would plot >50000 data points in less than 1s and capable of rotating > the plot? I would be happy to use it right away. > > Otherwise I am stuck with this "overflow" error. > > Do you know how to find the origin of an overflow error? In my case > not only it is intermitent, but it pops up from different parts of the > program. This is what I want to find out from MVP's such as you. > > > Athena > > *** Sent via Developersdex http://www.developersdex.com *** Athena <Ath***@devdex.com> wrote in news:ek8Ot6q1FHA.3204
@TK2MSFTNGP14.phx.gbl: Show quoteHide quote > Athena, > Mike, > > What I want is to plot a pointcloud data in 3D. Different parts of > the data is to have different colors. I should be able to rotate the > plot by using mouse. For this I have to write a piece of code either in > DirectX or OpenGL. Since I am not a professional programmer such as > yourself, my solution was to find a nice dll (NTGraph3d)and plot for x,y > and z sets (12 variables) using this dll. Do you know a VB code that > would plot >50000 data points in less than 1s and capable of rotating > the plot? I would be happy to use it right away. > > Otherwise I am stuck with this "overflow" error. > > Do you know how to find the origin of an overflow error? In my case > not only it is intermitent, but it pops up from different parts of the > program. This is what I want to find out from MVP's such as you. > > > Athena > > *** Sent via Developersdex http://www.developersdex.com *** I'm not going to attempt to help you with your code but I would like to thank you for pointing out this DLL. At first glance, it has SERIOUS power. Regards DanS Athena wrote:
Show quoteHide quote > If the overflow is in the VB code, it will pop up an error box w/ "error> Mike, > > What I want is to plot a pointcloud data in 3D. Different parts of > the data is to have different colors. I should be able to rotate the > plot by using mouse. For this I have to write a piece of code either in > DirectX or OpenGL. Since I am not a professional programmer such as > yourself, my solution was to find a nice dll (NTGraph3d)and plot for x,y > and z sets (12 variables) using this dll. Do you know a VB code that > would plot >50000 data points in less than 1s and capable of rotating > the plot? I would be happy to use it right away. > > Otherwise I am stuck with this "overflow" error. > > Do you know how to find the origin of an overflow error? In my case > not only it is intermitent, but it pops up from different parts of the > program. This is what I want to find out from MVP's such as you. 6" in the IDE. At that point you should be able to see which is the offending line (again in the IDE). Have you tested the identical data sets on the two machines where you get the overflow and don't to make sure it isn't just a data difference? If you get differing results on the two machines, then there obviously is a difference in the environment between the two. Start looking for revision levels of runtime, other installed software, etc. I concur that it would be wise to try to eliminate the Variants as much as possible. Having come from a background where it was necessary to maintain some really old FORTRAN code, I'm not nearly as upset about the argument lists altho it's not how I would code now, there is nothing inherently wrong w/ the code other than style---that is, it doesn't relate to the problem directly. See my post here about how to add error handling to all routines that
pinpoints the line number: http://groups.google.com/group/microsoft.public.vb.general.discussion/msg/da28c493c61c6b60 Also, it looks like you typed your code instead of using Copy&Paste. Please post code fragments and also the Dim statement. How a variable appears in a Dim statement is very important. In this example: Dim Num1, Num2 As Double Num1 is a Variant, Num2 is a Double. In VB6 and prior, use the following syntax: Dim Num1 As Double, Num2 As Double Show quoteHide quote "Athena" <gi***@comcast.net> wrote in message news:uFoTCbq1FHA.3660@TK2MSFTNGP15.phx.gbl... > Hi, > > My VB6 (SP6) app produces an Overflow error and bombs. I use Win XP > (Sp2). > > 1) Program has Option Explicit. So every variable is typed. > 2) Program works fine on one computer, but not on another! > 3) Error is intermittent. > 4) Sometimes it overflows even on VB timer function. > > I am using a dll that was created from another program. In the calling > statement, there are 13 output arguments (x1,y1,z1,...) defined as > Variant. They are arrays with no priory knowledge of their size. And there > are several input arguments (in1,in2...) typed as double. > > Dim b as variant > Dim x1 as variant > Dim y1 as variant > ...... > > call subroutine(13, > b,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4,in1,in2,in3,in4,...) > > These arrays used to plot a 3D graph: > > with Graph3D > > for i=1 to ubound(a1,1) > PlotXYZ x1(i,1),y1(i,1),z1(i,1),0 > next > for i=1 to ubound(a1,1) > PlotXYZ x2(i,1),y2(i,1),z2(i,1),1 > next > for i=1 to ubound(a1,1) > PlotXYZ x3(i,1),y3(i,1),z3(i,1),2 > next > for i=1 to ubound(a1,1) > PlotXYZ x4(i,1),y4(i,1),z4(i,1),3 > next > .autorange > > end with > > I believe the overflow is caused by somewhere in these for loops. If I > remove the last two or three loops it goes away! What the hell is going > on? > > Is there a way to detect/trap overflow? I run MS code advisor, it is > useless. Any help greatly be appreciated. Please help. > > Cem > > > > > > > Seriously buddy, it's hard to take you serious with a handle like "someone".
Any reason why you won't use a real name? - Kev Show quoteHide quote "Someone" <nob***@cox.net> wrote in message news:uyVMYNr1FHA.3816@TK2MSFTNGP14.phx.gbl... > See my post here about how to add error handling to all routines that > pinpoints the line number: > > http://groups.google.com/group/microsoft.public.vb.general.discussion/msg/da28c493c61c6b60 > > Also, it looks like you typed your code instead of using Copy&Paste. > Please post code fragments and also the Dim statement. How a variable > appears in a Dim statement is very important. > > In this example: > > Dim Num1, Num2 As Double > > Num1 is a Variant, Num2 is a Double. In VB6 and prior, use the following > syntax: > > Dim Num1 As Double, Num2 As Double > > > > > "Athena" <gi***@comcast.net> wrote in message > news:uFoTCbq1FHA.3660@TK2MSFTNGP15.phx.gbl... >> Hi, >> >> My VB6 (SP6) app produces an Overflow error and bombs. I use Win XP >> (Sp2). >> >> 1) Program has Option Explicit. So every variable is typed. >> 2) Program works fine on one computer, but not on another! >> 3) Error is intermittent. >> 4) Sometimes it overflows even on VB timer function. >> >> I am using a dll that was created from another program. In the calling >> statement, there are 13 output arguments (x1,y1,z1,...) defined as >> Variant. They are arrays with no priory knowledge of their size. And >> there are several input arguments (in1,in2...) typed as double. >> >> Dim b as variant >> Dim x1 as variant >> Dim y1 as variant >> ...... >> >> call subroutine(13, >> b,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4,in1,in2,in3,in4,...) >> >> These arrays used to plot a 3D graph: >> >> with Graph3D >> >> for i=1 to ubound(a1,1) >> PlotXYZ x1(i,1),y1(i,1),z1(i,1),0 >> next >> for i=1 to ubound(a1,1) >> PlotXYZ x2(i,1),y2(i,1),z2(i,1),1 >> next >> for i=1 to ubound(a1,1) >> PlotXYZ x3(i,1),y3(i,1),z3(i,1),2 >> next >> for i=1 to ubound(a1,1) >> PlotXYZ x4(i,1),y4(i,1),z4(i,1),3 >> next >> .autorange >> >> end with >> >> I believe the overflow is caused by somewhere in these for loops. If >> I remove the last two or three loops it goes away! What the hell is going >> on? >> >> Is there a way to detect/trap overflow? I run MS code advisor, it is >> useless. Any help greatly be appreciated. Please help. >> >> Cem >> >> >> >> >> >> >> > > Thank you,
I will certainlu look at your error handling routine. Athena Show quoteHide quote "Someone" <nob***@cox.net> wrote in message news:uyVMYNr1FHA.3816@TK2MSFTNGP14.phx.gbl... > See my post here about how to add error handling to all routines that > pinpoints the line number: > > http://groups.google.com/group/microsoft.public.vb.general.discussion/msg/da28c493c61c6b60 > > Also, it looks like you typed your code instead of using Copy&Paste. > Please post code fragments and also the Dim statement. How a variable > appears in a Dim statement is very important. > > In this example: > > Dim Num1, Num2 As Double > > Num1 is a Variant, Num2 is a Double. In VB6 and prior, use the following > syntax: > > Dim Num1 As Double, Num2 As Double > > > > > "Athena" <gi***@comcast.net> wrote in message > news:uFoTCbq1FHA.3660@TK2MSFTNGP15.phx.gbl... >> Hi, >> >> My VB6 (SP6) app produces an Overflow error and bombs. I use Win XP >> (Sp2). >> >> 1) Program has Option Explicit. So every variable is typed. >> 2) Program works fine on one computer, but not on another! >> 3) Error is intermittent. >> 4) Sometimes it overflows even on VB timer function. >> >> I am using a dll that was created from another program. In the calling >> statement, there are 13 output arguments (x1,y1,z1,...) defined as >> Variant. They are arrays with no priory knowledge of their size. And >> there are several input arguments (in1,in2...) typed as double. >> >> Dim b as variant >> Dim x1 as variant >> Dim y1 as variant >> ...... >> >> call subroutine(13, >> b,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4,in1,in2,in3,in4,...) >> >> These arrays used to plot a 3D graph: >> >> with Graph3D >> >> for i=1 to ubound(a1,1) >> PlotXYZ x1(i,1),y1(i,1),z1(i,1),0 >> next >> for i=1 to ubound(a1,1) >> PlotXYZ x2(i,1),y2(i,1),z2(i,1),1 >> next >> for i=1 to ubound(a1,1) >> PlotXYZ x3(i,1),y3(i,1),z3(i,1),2 >> next >> for i=1 to ubound(a1,1) >> PlotXYZ x4(i,1),y4(i,1),z4(i,1),3 >> next >> .autorange >> >> end with >> >> I believe the overflow is caused by somewhere in these for loops. If >> I remove the last two or three loops it goes away! What the hell is going >> on? >> >> Is there a way to detect/trap overflow? I run MS code advisor, it is >> useless. Any help greatly be appreciated. Please help. >> >> Cem >> >> >> >> >> >> >> > > You would need a good error trapping method. But just from a quick glance,
you may be using a 3rd party graphing component that is not installed, registered, or licensed on the other computer. Brian Show quoteHide quote "Athena" <gi***@comcast.net> wrote in message news:uFoTCbq1FHA.3660@TK2MSFTNGP15.phx.gbl... > Hi, > > My VB6 (SP6) app produces an Overflow error and bombs. I use Win XP > (Sp2). > > 1) Program has Option Explicit. So every variable is typed. > 2) Program works fine on one computer, but not on another! > 3) Error is intermittent. > 4) Sometimes it overflows even on VB timer function. > > I am using a dll that was created from another program. In the calling > statement, there are 13 output arguments (x1,y1,z1,...) defined as > Variant. They are arrays with no priory knowledge of their size. And there > are several input arguments (in1,in2...) typed as double. > > Dim b as variant > Dim x1 as variant > Dim y1 as variant > ...... > > call subroutine(13, > b,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4,in1,in2,in3,in4,...) > > These arrays used to plot a 3D graph: > > with Graph3D > > for i=1 to ubound(a1,1) > PlotXYZ x1(i,1),y1(i,1),z1(i,1),0 > next > for i=1 to ubound(a1,1) > PlotXYZ x2(i,1),y2(i,1),z2(i,1),1 > next > for i=1 to ubound(a1,1) > PlotXYZ x3(i,1),y3(i,1),z3(i,1),2 > next > for i=1 to ubound(a1,1) > PlotXYZ x4(i,1),y4(i,1),z4(i,1),3 > next > .autorange > > end with > > I believe the overflow is caused by somewhere in these for loops. If I > remove the last two or three loops it goes away! What the hell is going > on? > > Is there a way to detect/trap overflow? I run MS code advisor, it is > useless. Any help greatly be appreciated. Please help. > > Cem > > > > > > > On Fri, 21 Oct 2005 23:58:21 -0400, "Brian Shafer"
<bsgallatin@community.nospam> wrote: >You would need a good error trapping method. But just from a quick glance, Or maybe the other computer has a funny screen size or resolution>you may be using a 3rd party graphing component that is not installed, >registered, or licensed on the other computer. All those who reply for the "Error from Hell",
I found the source of error after almost 3 days of intense debugging by chance. And you won't belive what was the source of error. First of all let me remind you that the Error 6 "Overflow" was coming on random places sometimes on VB's own Timer function, not on a particular statment! Also this wasn't the most interesting thing that was happening: When I place the mouse over where the program stopped at in debug mode, the intellisense would say there is an overflow. Then I would move the mouse to one side and come back on the same variable. This time I would get NO error and the program would pass this line normally and but give me an overflow error on some other variable such as Timer function further in the program! So here is the culprit: My VB program uses a C based dll. This program does a lot of matrix based calculations to provide me points on a 3D mesh. It turns out some of these points were infinite! When I was checking the contents of the x,y, and z variables the program returns I realized that one of them was -1#.IND. Has anyone seen a number like this on VB? Now if you divide this number by 10, you would get the same number, or if you multiply it by1234 you still get -1#.IND. I checked Help, not a word of it. So after this realization, the solution was simple, I trapped them in the program generating these numbers and set them to zero. The problem was resolved. Thank you for all the answers. My regards, Athena Show quoteHide quote "Athena" <gi***@comcast.net> wrote in message news:uFoTCbq1FHA.3660@TK2MSFTNGP15.phx.gbl... > Hi, > > My VB6 (SP6) app produces an Overflow error and bombs. I use Win XP > (Sp2). > > 1) Program has Option Explicit. So every variable is typed. > 2) Program works fine on one computer, but not on another! > 3) Error is intermittent. > 4) Sometimes it overflows even on VB timer function. > > I am using a dll that was created from another program. In the calling > statement, there are 13 output arguments (x1,y1,z1,...) defined as > Variant. They are arrays with no priory knowledge of their size. And there > are several input arguments (in1,in2...) typed as double. > > Dim b as variant > Dim x1 as variant > Dim y1 as variant > ...... > > call subroutine(13, > b,x1,y1,z1,x2,y2,z2,x3,y3,z3,x4,y4,z4,in1,in2,in3,in4,...) > > These arrays used to plot a 3D graph: > > with Graph3D > > for i=1 to ubound(a1,1) > PlotXYZ x1(i,1),y1(i,1),z1(i,1),0 > next > for i=1 to ubound(a1,1) > PlotXYZ x2(i,1),y2(i,1),z2(i,1),1 > next > for i=1 to ubound(a1,1) > PlotXYZ x3(i,1),y3(i,1),z3(i,1),2 > next > for i=1 to ubound(a1,1) > PlotXYZ x4(i,1),y4(i,1),z4(i,1),3 > next > .autorange > > end with > > I believe the overflow is caused by somewhere in these for loops. If I > remove the last two or three loops it goes away! What the hell is going > on? > > Is there a way to detect/trap overflow? I run MS code advisor, it is > useless. Any help greatly be appreciated. Please help. > > Cem > > > > > > >
True type barcode font
The Elements of Style revisited. How to access related documents in VB through source code? DataSource class help Please Explain! MSDN Library on network location Global (Public) variables Verify a signed integer as even or odd Object Model Extraction webbroswer source problem |
|||||||||||||||||||||||