Hi, I just figured out what may be a really great way to
Subclass in VB 6. Here are the some of the features of this 'alpha'
product.
* Every handle you subclass gets a UNIQUE WindowProc ().
By 'unique' I mean the actual binary code for every
WindowProc is within it's own dynamically allocated chunk
of memory.
* Pressing the 'Stop' button does not crash the IDE. In fact
you can use breakpoints, step through code, and basically
perform all normal debugging operations.
* The implementation is an event-driven class. You can
respond before and after a window handle is subclassed
and before and after a WindowProc () is processed. If you
happen to respond before then you may also optinally
change the data before it reaches the original WindowProc ()
OR you may simply cancel the original WindowProc () (of
course meaning that you are handling the message 100%
on your own).
The attached ZIP file contains the class' code and a demo
application (code of course). I apologize for the lack of comments,
and the occasional un-used function... but this is hot off the grill.
To install and run everything:
* Unzip the attached .zip file to a location of your choosing.
* Compile \<Zip Location>\ldsClasser\ldsClasser.vbp (this is
the actual subclasser). A DLL will now exist (and the
compilation should have registered it). Note, when you first
open up the project you will get (an expected) error
message 'Unable to set version compatible component...'.
You can safely igore this because I had the project set to
binary compatibility in my environment.
* Compile \<Zip Location>\MITestApp\MultiTestAppProject.vbp
(this is the demo program). Note, you will need to change
the reference to the location of the newly compiled DLL or
you will get a missing-reference compilation error.
* Execute MultiTestAppProject.exe
My intention (aside from sharing this 'hopefully' new discovery)
is to get feedback from all you VB Subclassing maniacs out there...
whether you like it, hate it, think it needs to work differently,
think it's dangerous... (you get the point).
Thanks,
-CC
Last edited by Crunchy Cat; Sep 29th, 2002 at 01:12 AM.