Results 1 to 3 of 3

Thread: Property Sheet / Property Page interaction

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Question Property Sheet / Property Page interaction

    Hello and thanks for reading.

    I have a Property sheet in my Dialog application in which I have overridden the default operations of a few buttons. I've changed one of these buttons to "Clear". When it is clicked, I want to delete the contents of an edit box on one of the property pages. I'm trying to retrieve the CWnd of the edit box from the Property Sheet so that I can clear it out, but I'm not having any luck. Here's my code:
    VB Code:
    1. CWnd*  pWndEdit;
    2. pWndEdit = GetActivePage()->GetDlgItem(IDC_EDIT_SUBJECT,GetActivePage()->m_hWnd);
    I keep getting an error saying "IDC_EDIT_SUBJECT" is an undeclared identifier. How do I get the property sheet to recognize the ID of the edit box on the property page?

    Thanks,

    OneSource

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Are you sure the identifier is valid and "resource.h" is included?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Mobile, AL, USA
    Posts
    600

    Thumbs up That was it!

    CornedBee,

    I didn't include "resource.h" in the property sheet. After doing so, everything worked like a charm! Thanks for your help.

    Actually, my work around until your post did involve "resource.h". I opened the file and got the unique integer ID of the controls and used that on the property sheet and it worked. The code looked like this:
    Code:
    CWnd*  pWndEdit;
    pWndEdit = GetActivePage()->GetDlgItem(1093);
    Of course, just including "resource.h" is simpler, more direct and just better all around!

    Thanks again!

    OneSource

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width