Thread: displaying text in a MFC AppWizard window

  1. #1
    that guy
    Guest

    displaying text in a MFC AppWizard window

    hello, i created a MFC app with the AppWizard in VC++ 6, it has multiple documents... but they didnt have an example of how to put text into their mutiple ducument windows... so im lost on how to do this, im assuming its somhing like DrawText(...); but i dunno where to put it =/

    so im wondering where i could find a MFC tutorial dealing with the multiple document app created by the MFC Appwizard, all the MFC tuts i have found have nothing to do with multiple documents/the App wizard generated projects...

  2. #2
    Registered User
    Join Date
    Jul 2002
    Posts
    273
    Look up TextOut(). It should be a method on the CDC. At least it's an API you can call in Win32

  3. #3
    that guy
    Guest
    i looked it up, and understand it, but im not see'n where in the source to call it to print it to the screen, whether it be the main frame, or child window.

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Originally posted by that guy
    i looked it up, and understand it, but im not see'n where in the source to call it to print it to the screen, whether it be the main frame, or child window.
    Post some code...

  5. #5
    Registered User
    Join Date
    Feb 2002
    Posts
    589
    I don't remeber exactly. I think you need to create an event called OnDraw, Draw , Onpaint or something like that. Everything that goes to the screen should be done in that function

  6. #6
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Originally posted by that guy
    i looked it up, and understand it, but im not see'n where in the source to call it to print it to the screen, whether it be the main frame, or child window.
    On your MDI App you will have a "View" class......use that to draw on screen ala

    Code:
    void CTestMFC2View::OnPaint() 
    {
    	CPaintDC dc(this); // device context for painting
    	CRect rect;
    	GetClientRect(&rect);
    	dc.DrawText(_T("The most simple MFC App ever!"),
    		-1,rect,DT_CENTER | DT_VCENTER | DT_SINGLELINE);
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  2. edit box affecting displaying of text?
    By algi in forum Windows Programming
    Replies: 4
    Last Post: 05-04-2005, 03:28 PM
  3. input/output
    By dogbert234 in forum Windows Programming
    Replies: 11
    Last Post: 01-26-2005, 06:57 AM
  4. Outputting String arrays in windows
    By Xterria in forum Game Programming
    Replies: 11
    Last Post: 11-13-2001, 07:35 PM
  5. how to make 2 text window
    By bluexrogue in forum C Programming
    Replies: 2
    Last Post: 09-15-2001, 08:51 PM