Click here to Skip to main content
15,902,939 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I'm developing an application for pen drive in C. When i called GetProperties method of IVdsDisk, gets the error as "GetProperties is not a member of IVdsDisk".
Here is my piece of code,

HRESULT hResult;
IVdsDisk* pVdsDisk = NULL;
VDS_DISK_PROP diskProp;
hResult = pVdsDisk->GetProperties(&diskProp);


Can anyone suggest me why i get this error.

Regards
Mohan
Posted
Updated 7-Jan-11 2:42am
v2
Comments
Espen Harlinn 7-Jan-11 9:42am    
Was there anything wrong with the answer? Remeber to vote and mark questions as answered

It's been a number of years since I had to do any C++ or COM work, but try this:

C++
IVdsDisk* pVdsDisk = NULL;
HRESULT hResult = ppObjUnk->QueryInterface(IID_IVdsDisk, (void**)&pVdsDisk); 
if (hresult == SUCCESS)
{
    VDS_DISK_PROP diskProp;
    hResult = pVdsDisk->GetProperties(&diskProp);
}


 
Share this answer
 
v2
Comments
Espen Harlinn 7-Jan-11 8:54am    
5+ seems right, but tag indicates c, the operations has to be performed in a similar manner though - not c++
GetProperties is a documented member IVdsDisk::GetProperties[^]

Try moving the cursor in Visual Studio to GetProperties and press F12, BTW you are using C++ - in c things may look a little different.

Actually it looks like this in c
typedef struct IVdsDiskVtbl
    {
        BEGIN_INTERFACE
        
        HRESULT ( STDMETHODCALLTYPE *QueryInterface )( 
            __RPC__in IVdsDisk * This,
            /* [in] */ __RPC__in REFIID riid,
            /* [annotation][iid_is][out] */ 
            __RPC__deref_out  void **ppvObject);
        
        ULONG ( STDMETHODCALLTYPE *AddRef )( 
            __RPC__in IVdsDisk * This);
        
        ULONG ( STDMETHODCALLTYPE *Release )( 
            __RPC__in IVdsDisk * This);
        
        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetProperties )( 
            __RPC__in IVdsDisk * This,
            /* [out] */ __RPC__out VDS_DISK_PROP *pDiskProperties);
        
        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPack )( 
            __RPC__in IVdsDisk * This,
            /* [out] */ __RPC__deref_out_opt IVdsPack **ppPack);
        
        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetIdentificationData )( 
            __RPC__in IVdsDisk * This,
            /* [out] */ __RPC__out VDS_LUN_INFORMATION *pLunInfo);
        
        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *QueryExtents )( 
            __RPC__in IVdsDisk * This,
            /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*plNumberOfExtents) VDS_DISK_EXTENT **ppExtentArray,
            /* [out] */ __RPC__out LONG *plNumberOfExtents);
        
        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ConvertStyle )( 
            __RPC__in IVdsDisk * This,
            /* [in] */ VDS_PARTITION_STYLE NewStyle);
        
        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetFlags )( 
            __RPC__in IVdsDisk * This,
            /* [in] */ ULONG ulFlags);
        
        /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ClearFlags )( 
            __RPC__in IVdsDisk * This,
            /* [in] */ ULONG ulFlags);
        
        END_INTERFACE
    } IVdsDiskVtbl;
    interface IVdsDisk
    {
        CONST_VTBL struct IVdsDiskVtbl *lpVtbl;
    };


Regards
Espen Harlinn
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900