how to subclass in vc++.net 2002

  • Thread starter Thread starter Z.K.
  • Start date Start date
Z

Z.K.

I was wondering if someone could tell me how or point me to an
appropriate web page that will show me how to subclass a control in
vc++.net 2002. What I want to do is to be able to pop up a dialog box
when double clicking on a edit box. I tried using the OnLButtonDblClk,
but it does not work when double clicking on the edit box though it does
work when double clicking on the form itself.

Z.K.
 
Z.K. said:
I was wondering if someone could tell me how or point me to an
appropriate web page that will show me how to subclass a control in
vc++.net 2002. What I want to do is to be able to pop up a dialog box
when double clicking on a edit box. I tried using the OnLButtonDblClk,
but it does not work when double clicking on the edit box though it does
work when double clicking on the form itself.

Z.K.
There are lots of resources that will tell you how to do this. The high level
scheme is:

1. Use SetWindowLongPtr to replace the current wndproc by one of your own
design. (Save the return as OldProc)
2. In your procedure, set up a switch on the message and look for the
appropriate doubleclick message and pass every other message to OldProc.

/steveA
 
lots of resources, well, not that I could find. Most were about how to
subclass in visual C++ 6, which seems to be a bit different than in
dot.net. It was fairly easy in VC++ 6, but since visual studio.net no
longer has a class wizard or not one that is as useful I am having
trouble figuring how to do it. Oh well, thanks anyway. I guess I'll
have to buy a book and may that will tell me.

Z.K.
 
Back
Top