Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Write Text on child window - SDI application

Write Text on child window - SDI application

Scheduled Pinned Locked Moved C / C++ / MFC
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tagopi
    wrote on last edited by
    #1

    Hello Everybody, I have created one SDI Application with one dialog - having some controls. In that, if I click a button, I want to show a child window and with the following code, I am getting that fine.

    CMainFrame *pMainFrm = ((CMainFrame*)(AfxGetApp()->m_pMainWnd));
    CFrameWnd *pFrame = new CFrameWnd;
    RECT rect;
    pFrame->Create(NULL,_T("Solution"), WS_OVERLAPPEDWINDOW ,rect,this);
    pFrame->ModifyStyle(WS_CAPTION + WS_OVERLAPPEDWINDOW , WS_BORDER,SWP_NOMOVE +SWP_NOZORDER );

    pFrame->InitialUpdateFrame(pMainFrm->GetActiveDocument(),TRUE);
    pFrame->SetWindowPos(&CWnd::wndTopMost,100,200,1000,400,SWP\_SHOWWINDOW);
    pFrame->ActivateFrame(SW\_SHOWNORMAL);
    

    Now, I would like to write some text on that child window. Any suggestions? I tried in google also. Thanks in advance, A. Gopinath.

    L 1 Reply Last reply
    0
    • T tagopi

      Hello Everybody, I have created one SDI Application with one dialog - having some controls. In that, if I click a button, I want to show a child window and with the following code, I am getting that fine.

      CMainFrame *pMainFrm = ((CMainFrame*)(AfxGetApp()->m_pMainWnd));
      CFrameWnd *pFrame = new CFrameWnd;
      RECT rect;
      pFrame->Create(NULL,_T("Solution"), WS_OVERLAPPEDWINDOW ,rect,this);
      pFrame->ModifyStyle(WS_CAPTION + WS_OVERLAPPEDWINDOW , WS_BORDER,SWP_NOMOVE +SWP_NOZORDER );

      pFrame->InitialUpdateFrame(pMainFrm->GetActiveDocument(),TRUE);
      pFrame->SetWindowPos(&CWnd::wndTopMost,100,200,1000,400,SWP\_SHOWWINDOW);
      pFrame->ActivateFrame(SW\_SHOWNORMAL);
      

      Now, I would like to write some text on that child window. Any suggestions? I tried in google also. Thanks in advance, A. Gopinath.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Use one of the templates in Visual Studio, it contains all the framework code for the SDI client. You just need to add the actual display part, in the child window's OnPaint()[^] function.

      Use the best guess

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups