none
WPD & Interfaces - Is it good to keep interfaces RRS feed

  • Question

  • Hello,

    I'm developing an application that uses Windows Portable Device SDK. My question is as simple as this : is it a lot resource consuming to keep the IPortableDeviceManager interface pointer active ? What about the IPortableDevice themselves?

    Thanks for helping me out

    Louka Outrebon

    Friday, January 17, 2014 11:38 AM

Answers

  • The IPortableDeviceManager interface is lightweight to keep around but releasing it is safe as well.

    If you are not actively using the device, then releasing IPortableDevice and other interfaces obtained from it (e.g. IPortableDeviceContent and etc.) will free up at least 1 thread (or two if you called Advise). You'll need to cocreate and call Open if you do release the IPortableDevice pointer.

    Saturday, January 18, 2014 8:29 AM