Re: The UC - Windowless or Not
- From: Webbiz <nospam@xxxxxxxxxxxxxxxx>
- Date: Fri, 11 Sep 2009 01:01:35 -0500
On Thu, 10 Sep 2009 15:54:08 -0700, "Karl E. Peterson"
<karl@xxxxxxxxxx> wrote:
Webbiz wrote:
I downloaded, unzipped and then tried to run this example.
It gives a Run-Time Error 11 "Division by zero" error and breaks at a
Me.Refresh line in the UC.
That's just weird! I just downloaded what was there, double-clicked the VBP,
punched F5, and it ran just fine. No problem opening the form, either.
Because it breaks there, I haven't a clue what this error is about. So
I'm not able to run the code to see what it is suppose to do.
Any ideas?
Did you see the yellow bar? That means you can just press F8 and step into the
code, to see where the problem is occuring. I think the last time I really looked
at that code was over a decade ago. Hard to see how that error could pop.
Karl,
Here is what the little yellow bar led me to:
Private Function ReadProperties() As Boolean
Dim obj As PolyButton
If m_Parent Then
Call CopyMem(obj, m_Parent, 4)
m_Sides = obj.Sides
m_Offset = obj.Offset
m_Width = obj.ScaleWidth
m_Height = obj.ScaleHeight
Call CopyMem(obj, 0&, 4)
ReadProperties = True
End If
End Function
The error is caused by obj.Sides equal to zero. This is because it
will later be used to divide into another value and thus the Divide by
Zero error.
Strangely, this error pops up simply by wanting to look at the
PolyTest form itself without even running the program in the IDE. If
you watched the video, you'll see what I mean.
Is it normal for this ReadProperties function to run whenever you
simply click on the View Form button in the IDE, because that is
what's apparently happening.
;-0
Webbiz
.
- Follow-Ups:
- Re: The UC - Windowless or Not
- From: Karl E. Peterson
- Re: The UC - Windowless or Not
- From: Larry Serflaten
- Re: The UC - Windowless or Not
- From: Nobody
- Re: The UC - Windowless or Not
- References:
- The UC - Windowless or Not
- From: Webbiz
- Re: The UC - Windowless or Not
- From: Karl E. Peterson
- Re: The UC - Windowless or Not
- From: Webbiz
- Re: The UC - Windowless or Not
- From: Webbiz
- Re: The UC - Windowless or Not
- From: Webbiz
- Re: The UC - Windowless or Not
- From: Karl E. Peterson
- The UC - Windowless or Not
- Prev by Date: Re: Duplicate UC during Runtime
- Next by Date: Re: Duplicate UC during Runtime
- Previous by thread: Re: The UC - Windowless or Not
- Next by thread: Re: The UC - Windowless or Not
- Index(es):
Relevant Pages
|