CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Guest

    Enumerating controls in a form or dialogue box

    I have placed my own activeX control in a MFC dialogue box and using this control i want to enumerate all the controls that are
    present in that dialogue box. I am able to get the IClientSite pointer but unable to get the IOleContainter interface pointer.
    Does VC implements IOleContainer Interfacer?
    If not give me an alternative to enumerate the items present in the form or dialogue box.


  2. #2
    Join Date
    Jul 1999
    Location
    Romania - Iasi
    Posts
    558

    Re: Enumerating controls in a form or dialogue box

    With next function you will receive pointer to every controls in a dialog until the curent controls == intitialControl(the controls who have focus)

    void CMyDialog::Controls()
    {
    CWnd* pInitialCtrl = GetFocus();
    //do something with first control yhat is pInitialCtrl
    CWnd *pWndIterator = NextDlgCtrl();

    while( pWndIterator != pInitialCtrl )
    {
    //do something with the control
    pWndIterator = NextDlgCtrl();
    }
    }




    If that's help you let me know

    Best regards,
    Ovidiu


  3. #3
    Join Date
    Jul 1999
    Posts
    2

    Re: Enumerating controls in a form or dialogue box

    Thanks for the suggestion Ovidiu,
    I think this still doesnot solve my problem . I have an activex control created using ATL . The control requires to use the method inside the IOleContainer interface . The Control works fine in VB . Means to say that VB is implementing the interface IOleContainer. If I insert the same control inside the Dialogbox in a MFC based app. the control is not able to get the IOleContainer Interface pointer .
    I need to use the EnumObjects method inside the IOleContainer interface .
    Can someone throw light on this .
    regards
    ayyappan


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

Featured