IOleUIObjInfo::GetObjectInfo

Gets size, type, name and location information about an object.

HRESULT GetObjectInfo(
  DWORD dwObject,              //Unique 32-bit object identifier
  DWORD FAR *lpdwObjSize,      //Pointer to object's size
  LPTSTR FAR *lplpszLabel,     //Address of output variable that 
                               // receives a pointer to the object's 
                               // label string
  LPTSTR FAR * lplpszType,     //Address of output variable that 
                               // receives a pointer to the object's 
                               // long type string
  LPTSTR FAR * lplpszShortType,  //Address of output variable that 
                                 // receives a pointer to the object's 
                                 // short type string
  LPTSTR FAR * lplpszLocation  //Address of output variable that 
                               // receives a pointer to the object's 
                               // location string
);
 

Parameters

dwObject
[in] Unique 32-bit identifier for the object.
lpdwObjSize
[out] Pointer to the object's size, in bytes, on disk. This may be an approximate value.
lplpszLabel
[out] Address of LPTSTR pointer variable that receives a pointer to the object's label string. The parameter lplpszLabel may be NULL to indicate that the implementation should not return the label string.
lplpszType
[out] Address of LPTSTR pointer variable that receives a pointer to the object's long type string. The parameter lplpszType may be NULL to indicate that the implementation should not return the long type string.
lplpszShortType
[out] Address of LPTSTR pointer variable that receives a pointer to the object's short type string. The parameter lplpszShortType may be NULL to indicate that the implementation should not return the short type string.
lplpszLocation
[out] Address of LPTSTR pointer variable that receives a pointer to the object's source location string. The parameter lplpszLocation may be NULL to indicate that the implementation should not return the location string.

Return Values

This method supports the standard return values E_FAIL, E_INVALIDARG, and E_OUTOFMEMORY, as well as the following:

S_OK
Successfully returned object information.

Remarks

The strings and the object's size are displayed in the object properties "General" page.

Notes To Implementers

Your implementation of GetObjectInfo should place each of the object's attributes in the out parameters provided. Set lpdwObjSize to (DWORD)-1 when the size of the object is unknown. Allocate all strings (the rest of the params) with the OLE task allocator obtained via CoGetMalloc, as is standard for all OLE interfaces with [out] string parameters, or you can simply use CoTaskMemAlloc.

QuickInfo

  Windows NT: Use version 3.1 or later.
  Windows: Use Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in oledlg.h.

See Also

CoGetMalloc, CoTaskMemAlloc