Re: Using GetDevice function of IPortableDeviceManager interface...
I've never used this interface before, but it seems similar to other COM routines that return a list. As the documentation says, call it first with NULL to determine how many items exist, the allocate memory for the list, then call it again with your list. If I'm reading the docs correctly the list is an array of wide string pointers. The caller need only allocate the list of pointers. The function allocates memory for each string in the list and assigns them to your pointer list. Later, the caller is responsible for freeing the memory for each string. The code flow should be something like this:
//assume p is instantiated and points to the proper interface.
//count should be number of devices (maybe do sanity check).
devlist=new wchar_t *[count];