Click to See Complete Forum and Search --> : SetWindowText


savitha
April 20th, 1999, 05:42 AM
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.

Kanwardeep
April 21st, 1999, 12:46 AM
Hi Savitha,
Try to use SetWindowText() in OnDraw() function of the view window.

Regards,
Kanwardeep

savitha
April 21st, 1999, 06:56 AM
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.

varsh
April 21st, 1999, 01:49 PM
Hi, you can call GetDocument()->SetTitle() in your view's OnDraw() function.

Samar Aarkotti
April 21st, 1999, 02:19 PM
in the OnDraw()
call this it will work out... for sure.. i used it....
pDoc->SetTitle("Savitha");

feel free to contact me
at
Aarkotti@hotmail.com

dineshsv
April 30th, 1999, 06:38 AM
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