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. ATL / WTL / STL
  4. How to creat an Object from with a pointer

How to creat an Object from with a pointer

Scheduled Pinned Locked Moved ATL / WTL / STL
questioncsstutorial
3 Posts 2 Posters 5 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.
  • J Offline
    J Offline
    Jose Cruz
    wrote on last edited by
    #1

    I have this code wich creates a Grid, this works using a wrapper class. CdxDBGrid m_grid; m_grid.Create(_T("TestGrid"),WS_CHILD|WS_VISIBLE, CRect(1, 2, 3, 4), this, 1); So the question How do I achive the same as above but with a pointer. Or how do I create a View with my pointer. IdxDBGridPtr m_pGrid:((

    P 1 Reply Last reply
    0
    • J Jose Cruz

      I have this code wich creates a Grid, this works using a wrapper class. CdxDBGrid m_grid; m_grid.Create(_T("TestGrid"),WS_CHILD|WS_VISIBLE, CRect(1, 2, 3, 4), this, 1); So the question How do I achive the same as above but with a pointer. Or how do I create a View with my pointer. IdxDBGridPtr m_pGrid:((

      P Offline
      P Offline
      Paul M Watt
      wrote on last edited by
      #2

      CdxDBGrid *m_pgrid; // Allocate space for you object. m_pgrid = new CdxDBGrid; if (!m_pgrid) { return error; } // create the actual window that the object wraps. m_grid->Create(_T("TestGrid"),WS_CHILD|WS_VISIBLE, CRect(1, 2, 3, 4), this,1); // when you are done, delete the object. delete m_pgrid;


      Build a man a fire, and he will be warm for a day
      Light a man on fire, and he will be warm for the rest of his life!

      J 1 Reply Last reply
      0
      • P Paul M Watt

        CdxDBGrid *m_pgrid; // Allocate space for you object. m_pgrid = new CdxDBGrid; if (!m_pgrid) { return error; } // create the actual window that the object wraps. m_grid->Create(_T("TestGrid"),WS_CHILD|WS_VISIBLE, CRect(1, 2, 3, 4), this,1); // when you are done, delete the object. delete m_pgrid;


        Build a man a fire, and he will be warm for a day
        Light a man on fire, and he will be warm for the rest of his life!

        J Offline
        J Offline
        Jose Cruz
        wrote on last edited by
        #3

        First I appreciate your answer. But What I really want to know is, if it is a good idea to use a Grid that resides in a DLL. And if so How do I create an Object of it. I did this but with MFC and the autogenerated wrapper classes and everything works OK but I don`t know how to use it in a ATL/WTL project. This is because if I try to use the generated class I get some error about undefined class.:omg:

        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