Home All Groups Group Topic Archive Search About

Procedure limit for Form?

Author
10 Mar 2009 9:49 PM
C Kevin Provance
I've got a strange thing going on here.  Occasionally I have a form that
will not load, kicking back a runtime error 0 in the IDE.  Here is the odd
part, it triggers on the call to load (or show, it doesn't matter) that form
and not within the form itself.  Sometimes it happens and sometimes not.
Usually opening the form in the IDE and closing it again with a save stops
it for a while.  The only real difference is that this form has 166
procedures (according to MZ Tools).  Would haveing all those procedures be
mucking things up?  It comes out to 5, 995 lines of code.

The same error in the compil;ed EXE comes up as:

Failed to activate control 'VB.UserControl'. This control may be
incompatible with your application. Make sure you are using the version of
the control that was provided with your application.  The one user control
on that form is current.

I realize that is a lot of procedures and code for one form, and I suppose I
could put most of it in a BAS module, at least code that doesn't reference
the form in some way as much of it does.

Just looking for some thoughts.

Author
10 Mar 2009 10:27 PM
Eduardo
"C Kevin Provance" <BillMRapedMySh***@.netblows.ms> escribió en el mensaje
news:%239C9WocoJHA.1184@TK2MSFTNGP04.phx.gbl...
> I've got a strange thing going on here.  Occasionally I have a form that
> will not load, kicking back a runtime error 0 in the IDE.  Here is the odd
> part, it triggers on the call to load (or show, it doesn't matter) that
> form
> and not within the form itself.  Sometimes it happens and sometimes not.
> Usually opening the form in the IDE and closing it again with a save stops
> it for a while.  The only real difference is that this form has 166
> procedures (according to MZ Tools).  Would haveing all those procedures be
> mucking things up?  It comes out to 5, 995 lines of code.
[...]

Hi,

I have a form with much code, I don't have MZ Tools installed, but I pasted
the code into Word and it says: 9,415 paragraphs, 248,676 characters
(without spaces).
And it works fine.

I don't know how many procedures, I would have to install MZ Tools to see
that.
Author
10 Mar 2009 10:52 PM
Karl E. Peterson
C Kevin Provance wrote:
> I realize that is a lot of procedures and code for one form, and I suppose I
> could put most of it in a BAS module, at least code that doesn't reference
> the form in some way as much of it does.
>
> Just looking for some thoughts.

You won't like mine.  I had that once, and damned if I can pull up where it was
discussed.  But it was a *totally* weird hack that triggered it.  (Maybe I was
checking whether an array was empty by Not'ing it's varptr?  It was a slimeball
hack, I tellya <g>)  Error 0 means VB is *totally* messed up.

On the "up" side, I don't think you're anywhere near hitting hard limits.
--
..NET: It's About Trust!
http://vfred.mvps.org
Author
10 Mar 2009 11:58 PM
C Kevin Provance
"Karl E. Peterson" <k***@mvps.org> wrote in message
news:%234gWXLdoJHA.3840@TK2MSFTNGP03.phx.gbl...
| You won't like mine.  I had that once, and damned if I can pull up where
it was
| discussed.  But it was a *totally* weird hack that triggered it.  (Maybe I
was
| checking whether an array was empty by Not'ing it's varptr?  It was a
slimeball
| hack, I tellya <g>)  Error 0 means VB is *totally* messed up.
|
| On the "up" side, I don't think you're anywhere near hitting hard limits.

Well, that's good, about not hitting the limits.

I don't think I have any slimey hacks in the form in question.  The code in
Form_Load isn't even executing (and there is nothing in Form_Initialize).

The runtime 0 occurs in Sub Main at the line: Load frmMain

It's seemingly random.  But if I'm to believe the errors the exe kicks out,
it's got something to do with a VBControl.  I'll keep Googling.  :\
Author
11 Mar 2009 1:25 AM
Nobody
Are you subclassing anything? If so, which object?
Author
11 Mar 2009 2:29 AM
C Kevin Provance
"Nobody" <nob***@nobody.com> wrote in message
news:uXqEEheoJHA.4392@TK2MSFTNGP05.phx.gbl...
| Are you subclassing anything? If so, which object?

No subclassing in this case.  No callbacks either.
Author
11 Mar 2009 2:49 AM
Randem
There is a 64kb limit on all objects. This includes pictures, code and
anything else contained in that object. So if your code goes beyond that you
are in trouble. This does not mean words or lines in your object but at
compile time...

--
Randem Systems
Your Installation Specialist
The Top Inno Setup Script Generator
http://www.randem.com/innoscript.html
How Banks STEAL Your Money
www.financialtrainingservices.org/bankreviews.htm
Disk Read Error Press Ctl+Alt+Del to Restart
http://www.randem.com/discus/messages/9402/9406.html?1236319938

Show quoteHide quote
"C Kevin Provance" <BillMRapedMySh***@.netblows.ms> wrote in message
news:%239C9WocoJHA.1184@TK2MSFTNGP04.phx.gbl...
> I've got a strange thing going on here.  Occasionally I have a form that
> will not load, kicking back a runtime error 0 in the IDE.  Here is the odd
> part, it triggers on the call to load (or show, it doesn't matter) that
> form
> and not within the form itself.  Sometimes it happens and sometimes not.
> Usually opening the form in the IDE and closing it again with a save stops
> it for a while.  The only real difference is that this form has 166
> procedures (according to MZ Tools).  Would haveing all those procedures be
> mucking things up?  It comes out to 5, 995 lines of code.
>
> The same error in the compil;ed EXE comes up as:
>
> Failed to activate control 'VB.UserControl'. This control may be
> incompatible with your application. Make sure you are using the version of
> the control that was provided with your application.  The one user control
> on that form is current.
>
> I realize that is a lot of procedures and code for one form, and I suppose
> I
> could put most of it in a BAS module, at least code that doesn't reference
> the form in some way as much of it does.
>
> Just looking for some thoughts.
>
>
Author
11 Mar 2009 5:00 PM
Daryl Muellenberg
I had something similar happen to me and what resolved it for me was to
recreate the form. Something was messed up with the original form, and it
didn't happen all the time. But after I made a new form and replaced the old
form the problem went away.

Daryl


Show quoteHide quote
"C Kevin Provance" <BillMRapedMySh***@.netblows.ms> wrote in message
news:%239C9WocoJHA.1184@TK2MSFTNGP04.phx.gbl...
> I've got a strange thing going on here.  Occasionally I have a form that
> will not load, kicking back a runtime error 0 in the IDE.  Here is the odd
> part, it triggers on the call to load (or show, it doesn't matter) that
> form
> and not within the form itself.  Sometimes it happens and sometimes not.
> Usually opening the form in the IDE and closing it again with a save stops
> it for a while.  The only real difference is that this form has 166
> procedures (according to MZ Tools).  Would haveing all those procedures be
> mucking things up?  It comes out to 5, 995 lines of code.
>
> The same error in the compil;ed EXE comes up as:
>
> Failed to activate control 'VB.UserControl'. This control may be
> incompatible with your application. Make sure you are using the version of
> the control that was provided with your application.  The one user control
> on that form is current.
>
> I realize that is a lot of procedures and code for one form, and I suppose
> I
> could put most of it in a BAS module, at least code that doesn't reference
> the form in some way as much of it does.
>
> Just looking for some thoughts.
>
>
Author
11 Mar 2009 8:00 PM
mayayana
I don't know if this applies to your situation, but
I've had similar problems when working with a
DLL/EXE that I'm working on and using in a project.
The gist of it seems to be that VB can't really handle
binary compatibility setting. Once compat. is broken
it just keeps issuing warnings over and over, having
trouble loading, etc. I find that I just have to wait
until I've got my interfaces in final form, then clean
out the mess of multiple entries that VB has created
in HKCR\CLSID and HKCR\Typelib, delete my binary
template file, and start over, setting binary compatibility
on a new compile that won't be changing.
Author
12 Mar 2009 12:41 AM
Kevin Provance
Show quote Hide quote
"mayayana" <mayayaX***@rcXXn.com> wrote in message
news:ex0revnoJHA.3380@TK2MSFTNGP04.phx.gbl...
|  I don't know if this applies to your situation, but
| I've had similar problems when working with a
| DLL/EXE that I'm working on and using in a project.
| The gist of it seems to be that VB can't really handle
| binary compatibility setting. Once compat. is broken
| it just keeps issuing warnings over and over, having
| trouble loading, etc. I find that I just have to wait
| until I've got my interfaces in final form, then clean
| out the mess of multiple entries that VB has created
| in HKCR\CLSID and HKCR\Typelib, delete my binary
| template file, and start over, setting binary compatibility
| on a new compile that won't be changing.

I get what you're saying here, but the only two AX controls on that form are
Spyworks (cross task subclasser) and my own custom command button which has
not been modified for years.  I asked the one user I've been working with
about this, and he *claims* that he reinstalled my program after wiping his
hard drive and starting over, so it was technically a clean install.  No
left overs.  I did have him delete the OCA files, but have not heard back
yet.
Author
11 Mar 2009 10:32 PM
Nobody
See if clearing the temp folder fixes it...