Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Subclassing - access control properties from its hWnd

Posted on 1997-05-02
2
Medium Priority
?
261 Views
Last Modified: 2011-10-03
I am current attempting to use VB5 to subclass the MaskEdBox control.  This involves coding a C-Style WndProc that has the arguments: hWnd, uMsg, wParam, lParam and redirecting the messages sent to the control to the WndProc.  Here's my question:  Using the hWnd passed to the proc, how can I access the Mask property of the MaskEdBox control?
0
Comment
Question by:Rosedust
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
dansari earned 200 total points
ID: 1425923
I believe you cannot access properties of an OLE control just by knowing its hWnd - the window of an OLE control is actually quite removed from the "heart" of the control.

Your method would work fine if you're subclassing a regular Windows control.

But, if you want to subclass an OLE (ActiveX) control, you should use VB5 to create an ActiveX project, and use the MaskEdBox in here.  This way, your control acts as a "wrapper" around the MaskEdBox.  You can make a Mask property (as well as all the other properties/methods/events of MaskEdBox) in your control,
so that it will behave as much like MaskEdBox as you want.
0
 

Author Comment

by:Rosedust
ID: 1425924
The ActiveX / OLE solution is unacceptable because it is extremely slow when compared to the subclassing method.  If a single form has a large number of these controls, the user is forced to sit and wait while the controls load.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question