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. Directing Window Ouput

Directing Window Ouput

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.
  • P Offline
    P Offline
    Peter Liddle
    wrote on last edited by
    #1

    Hey Guys I have a CView dirived class i am using as my main view in an MDI application and i have a CWnd derived class which is a control i am writing how do i get the control to be drawn inside the CView Class i have tried BeginPaint and Print with no luck. At the moment i create the control in the create part of the CView and then check for a safe handle in the paint of teh cview before calling BeginPaint of the control which doesn't work. Cheers Peter

    R 1 Reply Last reply
    0
    • P Peter Liddle

      Hey Guys I have a CView dirived class i am using as my main view in an MDI application and i have a CWnd derived class which is a control i am writing how do i get the control to be drawn inside the CView Class i have tried BeginPaint and Print with no luck. At the moment i create the control in the create part of the CView and then check for a safe handle in the paint of teh cview before calling BeginPaint of the control which doesn't work. Cheers Peter

      R Offline
      R Offline
      Roger Allen
      wrote on last edited by
      #2

      If you have created you CWnd derived control as a chile window of the CView, then as long as its visible and withoin the CView's client area then it should appear. Make sure when creating the control that the WS_CHILD and WS_VISIBLE style have been set. For example, in one of my apps, I create a list of controls like this:

      m\_Log.Create("Log window", WS\_CHILD | WS\_VISIBLE | SS\_SUNKEN | SS\_CENTERIMAGE | SS\_NOTIFY| WS\_CLIPSIBLINGS, CRect(10, 10, 100, 100), this, IDC\_EDIT1) ;
      m\_WhizWheel.Create("Wheel", WS\_CHILD | WS\_VISIBLE | SS\_BITMAP | SS\_NOTIFY | WS\_CLIPSIBLINGS, CRect(0, 0, 20, 20), this, IDC\_WHIZ\_WHEEL) ;
      m\_WhizWheel.SetBitmap(m\_WheelBitmap\[m\_BitmapIndex\]) ;
      m\_TrayProgress.Create(WS\_CHILD | WS\_VISIBLE | PBS\_SMOOTH | SS\_NOTIFY | WS\_CLIPSIBLINGS, CRect(10, 10, 15, 100), this, IDC\_TRAY\_PROGRESS) ;
      m\_SampleProgress\[0\].Create(WS\_CHILD | WS\_VISIBLE | PBS\_SMOOTH | SS\_NOTIFY | WS\_CLIPSIBLINGS, CRect(20, 10, 25, 100), this, IDC\_SAMPLE\_PROGRESS1) ;
      m\_SampleProgress\[1\].Create(WS\_CHILD | WS\_VISIBLE | PBS\_SMOOTH | SS\_NOTIFY | WS\_CLIPSIBLINGS, CRect(20, 10, 25, 100), this, IDC\_SAMPLE\_PROGRESS2) ;
      m\_SampleProgress\[2\].Create(WS\_CHILD | WS\_VISIBLE | PBS\_SMOOTH | SS\_NOTIFY | WS\_CLIPSIBLINGS, CRect(20, 10, 25, 100), this, IDC\_SAMPLE\_PROGRESS3) ;
      m\_SampleProgress\[3\].Create(WS\_CHILD | WS\_VISIBLE | PBS\_SMOOTH | SS\_NOTIFY | WS\_CLIPSIBLINGS, CRect(20, 10, 25, 100), this, IDC\_SAMPLE\_PROGRESS4) ;
      
      m\_ValveStatus.Create("?", WS\_CHILD | WS\_VISIBLE | SS\_NOTIFY | WS\_CLIPSIBLINGS, CRect(0, 0, 15, 15), this, IDC\_VALVE\_LED) ;
      m\_DadStatus.Create("?", WS\_CHILD | WS\_VISIBLE | SS\_NOTIFY | WS\_CLIPSIBLINGS, CRect(0, 0, 15, 15), this, IDC\_DAD\_LED) ;
      m\_LampStatus.Create("?", WS\_CHILD | WS\_VISIBLE | SS\_NOTIFY | WS\_CLIPSIBLINGS, CRect(0, 0, 15, 15), this, IDC\_LAMP\_LED) ;
      m\_DeviceStatus\[0\].Create("?", WS\_CHILD | WS\_VISIBLE | SS\_NOTIFY | WS\_CLIPSIBLINGS, CRect(0, 0, 15, 15), this, IDC\_DEVICE1\_LED) ;
      m\_DeviceStatus\[1\].Create("?", WS\_CHILD | WS\_VISIBLE | SS\_NOTIFY | WS\_CLIPSIBLINGS, CRect(0, 0, 15, 15), this, IDC\_DEVICE2\_LED) ;
      

      I then later on use MoveWindow() on each of the controls to place them exactly where I want them to be. Roger Allen Sonork 100.10016 I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.

      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