Solved

Subclassing - access control properties from its hWnd

Posted on 1997-05-02
2
254 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 100 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

734 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