CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11

Threaded View

  1. #1
    Join Date
    Dec 2010
    Posts
    907

    boost::shared_ptr with std::vector

    Code:
    std::vector<CObjects*> m_pRenderObjects;
    
    //////// Load Warehouse info
    		 
    		boost::shared_ptr<CWarehouse> sobj(new CWarehouse());
    		m_Warehouse.Load(m_pd3dDevice, _effect, _T("Data\\DemoWarehouse.x"));
    
    		sobj->Create(&m_Warehouse);
    	 
    
    		/////// Load CB info positions, models etc
    		 
    		boost::shared_ptr<CCB> sccb(new CCB());
    		m_CCB.Load(m_pd3dDevice, _effect, _T("Data\\cb.x"));
    
    		sccb->Create(&m_CCB);
    
    
    
    
    		m_pRenderObjects.push_back(sobj.get());
    
    		m_pRenderObjects.push_back(sccb.get());
    
    
    //////////////////////
    
    for (int i = 0; i < objects.size(); i++)
        objects[i]->Render();
    error:
    0xC0000005: reading location 0xfeeefef2 [Translated]
    Last edited by lucky6969b; August 12th, 2012 at 03:17 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured