how to subclass in vc++.net 2002

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.
 
S

Steve Alpert

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
 
Z

Z.K.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top