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

Thread: SetWindowText

  1. #1
    Join Date
    Apr 1999
    Posts
    11

    SetWindowText

    I have a window which is an SDI. I want to set the title using SetWindowText("Test"); in the view of the project. I tried giving this in the constructor of the View. It is giving me a GPF. Please suggest me a solution to this problem.

    Thank you
    Savitha.

    Savitha.

  2. #2
    Join Date
    Apr 1999
    Posts
    7

    Re: SetWindowText

    Hi Savitha,
    Try to use SetWindowText() in OnDraw() function of the view window.

    Regards,
    Kanwardeep


  3. #3
    Join Date
    Apr 1999
    Posts
    11

    Problems with the solution that you provided

    Hi. Kanwardeep.I tried calling SetWindowText() from OnDraw(). It looked like SetWindowText("Test App"); I did not provide the handle to the main window. Will it recoginze that the title of the main window has to be changed or else should i provide some handle/object along with the SetWindowText(). The solution provided did not work. .Please clarify this doubt.

    Thankyou.

    Savitha.

  4. #4
    Join Date
    Apr 1999
    Posts
    3

    Re: Problems with the solution that you provided

    Hi, you can call GetDocument()->SetTitle() in your view's OnDraw() function.


  5. #5
    Join Date
    Apr 1999
    Posts
    13

    Re: SetWindowText

    in the OnDraw()
    call this it will work out... for sure.. i used it....
    pDoc->SetTitle("Savitha");

    feel free to contact me
    at
    [email protected]


  6. #6
    Join Date
    May 1999
    Posts
    16

    Re: SetWindowText

    Hi Savitha,

    you can use GetDocument()->SetTitle("Title"); in OnInitialUpdate() message handler of View class.

    When creating new document it is like this :
    CDocument m-pCliDoc = NULL;
    m_pCliDoc = pDocTemplateCli->OpenDocumentFile( NULL, TRUE);
    if(m_pClidoc)
    m_pCliDoc->SetTitle("TestTitle");

    Bye,
    Dinesh


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