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. What is the difference??

What is the difference??

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 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.
  • A Offline
    A Offline
    ashwath2005
    wrote on last edited by
    #1

    I have the below code: There is a classs"CPaintDC". Can anyone please tell me what is the difference between the following 2 statements: 1.)CPaintDC *pDC = new CPaintDC(this); 2.)CPaintDC* pDC=new CPaintDC;

    T I 2 Replies Last reply
    0
    • A ashwath2005

      I have the below code: There is a classs"CPaintDC". Can anyone please tell me what is the difference between the following 2 statements: 1.)CPaintDC *pDC = new CPaintDC(this); 2.)CPaintDC* pDC=new CPaintDC;

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      1. calls the CPaintDC contructor which receives a CWnd* parameter, and initializes it with the this pointer passed, 2. calls the CPaintDC default constructor...

      1 Reply Last reply
      0
      • A ashwath2005

        I have the below code: There is a classs"CPaintDC". Can anyone please tell me what is the difference between the following 2 statements: 1.)CPaintDC *pDC = new CPaintDC(this); 2.)CPaintDC* pDC=new CPaintDC;

        I Offline
        I Offline
        includeh10
        wrote on last edited by
        #3

        DC is related to Window, in other words, we say "a DC of a window". 1) the DC of "this" window - similar to ::GetDC(this->m_hWnd); 2) the DC of screen - similar to ::GetDC(0).


        A special image tool for Windows C++ programmers, don't miss it! A nice hyper tool for optimizing your Microsoft html-help contents. Includeh10

        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