|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Subclassing a la CatonTo 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. Hi,
mayayana schrieb: > To anyone who has used Paul Caton's subclassing... This is old. Look at (SelfSub2.1):> > 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 <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> > >
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=42918&ln
> > gWId=1 <http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=64867&lng> > This is old. Look at (SelfSub2.1): > > WId=1> > Thanks, but I think that one is older. The one I linkedwas 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 <http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=68737&lng> LaVolpes > > 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? mayayana schrieb:
> http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=42918&ln Umpf. At the authors submission page you can read that it was updated >>> 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. "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> 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. > 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. 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. :) 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 > Paul Caton DOES support his version. If you mail him, he will send you Thanks. I wonder why he hasn't posted it online. The many> the latest version I believe. Last revision was only a few months ago. > Ulf 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. 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.
Wrap a Long String
Determining Available Paper Sizes on Printer Number Puzzle vb6 closes with erro after I installed msdn oct 2001 Error #429 and compactdatabase in VB6 ListBox bug? Excel Library in VB 2008 on 64-bit OS installation Using VBPRNDLG.DLLl Instead of Print Common Dialog Boxes VSM Wants Your Feedback Control Container Property - Why Use It? |
|||||||||||||||||||||||