Link to home
Start Free TrialLog in
Avatar of CrazyLee
CrazyLee

asked on

Subclass a control on a property page: problems ???

This question was posted by another person on another forum, but it is exactly the issue I'm running into also. I dont know and cant find the answer he got, but someone here at EE helped him out to success and I need the same answers. Thank You.

I'm trying to dynamically subclass a field on a property page.  The code looks like this:

  BOOL CMyPropertyPage::OnInitDialog()
  {
    CPropertyPage::OnInitDialog();
    m_myedithandler.SubclassDlgItem(IDC_TEXT,this);
    return TRUE;  
  }

The SubclassDlgItem fails on an ASSERT in

  BOOL CWnd::Attach(HWND hWndNew)
  {
    ASSERT(m_hWnd == NULL);                       //OK
    ASSERT(FromHandlePermanent(hWndNew) == NULL); //fails
    ...

I used the same override logic on an edit field in a regular dialog
without any problem.  Is there something special about subclassing
on a property page?  Or can someone point me to something else
I am doing wrong?
Avatar of cypherljk
cypherljk

CrazyLee,
Howdy MS states that you can't assiciate DDX/DV with controls that you wish to subclass. That is your problem. Here is the link to the exact MSDN problem and how to solve it.  http://support.microsoft.com/support/kb/articles/Q113/4/21.asp

My 2 cents...
Hi,

I will try & mail back to u.

From

MRN Murthy
Avatar of CrazyLee

ASKER

My email is rstudley@intersil.com
cypherljk ,
Did you get points for the answer? I'm new to the system
and havn't been able to verify.
Thanks,
Lee
No I didn't get the points you have to accept my comment as an answer or I can submit an answer; if you like, so yo can explicitly accept it. Glad to be of help.

My2 cents.
Hi,
I thought I had done it correclty, I hit accept as answer
and graded it(A+)and also tried just 'accept' and close, but have seen no feedback that it actually happened...
Be nice if they popped up a 'recieved' dialog or something.
It kept going to your info/stats page and that was it.
Thanks and let me know if it still doesnt go thru,
This is a great forum and your response was quick!

Lee
ASKER CERTIFIED SOLUTION
Avatar of cypherljk
cypherljk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think I was accepting AND leaving a comment and they cant both be done at the same time. Thanks again.
-Lee