This might be considered an elementary question for those with COM
emblazened upon their belt buckles, but I know just enough about it to be
dangerous! Here goes...
If I include <dskquota.h>, I can use the following code just fine:
IDiskQuotaControl *lpDiskQuotaControl;
IEnumDiskQuotaUsers *lpEnumDiskQuotaUsers;
HRESULT hr = CoCreateInstance(CLSID_DiskQuotaControl,
NULL,
CLSCTX_INPROC_SERVER,
IID_IDiskQuotaControl,
(LPVOID*)&lpDiskQuotaControl);
if (SUCCEEDED(hr))
{
hr = lpDiskQuotaControl->Initialize(_bstr_t("c:\\"), TRUE);
if (SUCCEEDED(hr))
{
hr = lpDiskQuotaControl->CreateEnumUsers(NULL, 0,
DISKQUOTA_USERNAME_RESOLVE_SYNC,
&lpEnumDiskQuotaUsers);
...
}
lpDiskQuotaControl->Release();
}
If, however, I wanted to use smart pointers instead with #import
<dskquota.dll> then the CreateEnumUsers() method does not show up in the
.tlh or .tli file. There also does not appear to be an interface for the
users (plural). Is it supposed to be this way, or what am I doing wrong?
Thanks,
DC