Jordy van Londen

Members
  • Content count

    2
  • Joined

  • Last visited

Community Reputation

115 Neutral

About Jordy van Londen

  • Rank
    Newbie
  1. So if this is my class: class MyClass { private: CComPtr<IDirect3DDevice9> d3ddev; public: MyClass(IDirect3DDevice9 * _d3ddev) { this->d3ddev = _d3ddev; } }; And I would create an instance of it like this: CComPtr<IDirect3DDevice9> d3ddev; InitDevice() { // d3ddev gets inititialized here } SomeFunction() { InitDevice(); MyClass myclass1(d3ddev); } Then that would be fine?
  2. How do I safely pass a CComPtr<IDirect3DDevice9> to another class via its constructor? Do I pass by reference or by value? Which way does the CComPtr actually add to the reference counter? And do I store it as raw pointer or another CComPtr in the newly created class?  I'm bit overwhelmed by the pointers, references and memory leaks I have to deal with coming from C# :-/   Thanks for your help in advance,   Jordy