How to creat an Object from with a pointer
-
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:((
-
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:((
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! -
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!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: