Home All Groups Group Topic Archive Search About
Author
7 Mar 2009 10:36 PM
mayayana
To anyone who has used Paul Caton's subclassing...

  I've been experimenting with the Planet Source Code
subclassing code by Paul Caton, which seems to
be DEP-safe:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=42918&ln
gWId=1

  After a couple of rough days with crashes (only on
Win98 and only when compiled!) I seem to have got a
good, stable method using this particular code. (He's
got several versions.) It works fine running a mix of
50-odd simultaneous subclasses, including custom
UserControls, owner-drawn RichEdit windows, etc.

  I'm just curious about other people's thoughts, experiences,
confidence with this method. Paul Caton's work seems to be
highly regarded, but this is the first time I've run into it.

Author
7 Mar 2009 11:30 PM
Ulrich Korndoerfer
Hi,

mayayana schrieb:
> To anyone who has used Paul Caton's subclassing...
>
>   I've been experimenting with the Planet Source Code
> subclassing code by Paul Caton, which seems to
> be DEP-safe:
> http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=42918&ln
> gWId=1

This is old. Look at (SelfSub2.1):

<http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=64867&lngWId=1>

Also note that Paul Caton is not longer the maintainer. Have a look at
LaVolpes

<http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=68737&lngWId=1>

--
Ulrich Korndoerfer

VB tips, helpers, solutions -> http://www.proSource.de/Downloads/
Author
8 Mar 2009 5:28 AM
mayayana
> >
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=42918&ln
> > gWId=1
>
> This is old. Look at (SelfSub2.1):
>
>
<http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=64867&lng
WId=1>
>
  Thanks, but I think that one is older. The one I linked
was updated in 2007. I first tried the v. 2 code, which
goes into a UserControl directly, but I got nasty crashes
on Win98 when the compiled EXE was run. I couldn't
figure out the cause. (It was strange. The EXE ran fine in
XP and in the IDE, but once compiled the window would
begin to "disassemble" shortly after starting up in 98, there
would be a crash, then Explorer would be so slow I'd have
to reboot. It actually worked OK with the most simple subclass.
The crash was in a larger program, with several API-owner-drawn
RichEdit windows.) Maybe I could have worked out the bugs, but
the v. 3 code turned out to work fine and was easier to set up.
It's a class and typelib, with just a bit of code needed in the
UserControl.

> Also note that Paul Caton is not longer the maintainer. Have a look at
> LaVolpes
>
>
<http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=68737&lng
WId=1>
>

  I looked at his code. He's got some other stuff at PSC, too.
But there's a lot squeezed in there. I found it very hard to follow,
since I don't know asm, and, like Paul Caton, Volpe provided no
documentation at all. It was just too confusing to figure it
out. Unfortunately it seems that the most talented coders
are often less than talented with language and rarely bother
to *explain* their code.

    So... you're familiar with the Caton/Volpe code and have
had good luck with it?
Author
8 Mar 2009 5:50 AM
Ulrich Korndoerfer
mayayana schrieb:
> http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=42918&ln
>>> gWId=1
>> This is old. Look at (SelfSub2.1):
>>
>>
> <http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=64867&lng
> WId=1>
>   Thanks, but I think that one is older. The one I linked
> was updated in 2007.

Umpf. At the authors submission page you can read that it was updated
"3/07". However if you've read carefully you would have seen that this
means 3/7/2003.

--
Ulrich Korndoerfer

VB tips, helpers, solutions -> http://www.proSource.de/Downloads/
Author
8 Mar 2009 6:12 AM
mayayana
>
> Umpf. At the authors submission page you can read that it was updated
> "3/07". However if you've read carefully you would have seen that this
> means 3/7/2003.
>

   Oh, it looks like you're right. Checking the last modified
date on the files I have they're all 2003! In any case, it
worked well and seems preferable to the other package,
in that it ran crash-free the first time and was less work to
set up.
  I'm waiting for word from my Vista DEP test volunteer on
whether it's DEP-safe. If it is then I don't see any reason
to try again shoehorning the other code into my userControls.

   Was there anything in particular about the later code
that's superior to the code I used? Since I don't know
asm I really don't know how to assess this code.
Author
8 Mar 2009 1:17 PM
mayayana
Never mind my last post, Ulrich. I realized
later that 2003 pre-dated DEP. So I wasted my
time and will have to rewrite. Thank you for
clearing up the dates. I would have been very
confused to find that my spiffy new "2007"
version was not DEP-safe. :)
Author
8 Mar 2009 7:09 PM
Ulf Christenson
Paul Caton DOES support his version. If you mail him, he will send you
the latest version I believe. Last revision was only a few months ago.
Ulf
Author
8 Mar 2009 8:48 PM
mayayana
> Paul Caton DOES support his version. If you mail him, he will send you
> the latest version I believe. Last revision was only a few months ago.
> Ulf

  Thanks. I wonder why he hasn't posted it online. The many
outdated versions on Planet Source Code are confusing. I
ended up wasting a lot of time with code that turned out to
be pre-DEP. And it would be interesting to see what his latest
version looks like.

  But I did manage to create a nice stripped-down class from
the "LaVolpe" code. He squeezed a lot into a single class (like
hooking the keyboard, enumerating fonts, etc.! ) but he did it
in a very orderly way, making it relatively easy to dissect. One
instance of the class seems to easily subclass as many windows
as I might ever need to pass to it, and it runs fine on Win9x.
Author
8 Mar 2009 9:49 PM
Ulf Christenson
Okay, I don't know about LaVolpe's subclasser, but he is a VERY
intelligent person, and I am sure that he also did it nicely.
Personally, I always used Paul's version and with the latest update all
is fine. I don't know why he hasn't posted it.