IClusCfgInitialize::Initialize method

[This method is available for use only in Windows Server 2003.]

The Initialize method provides initialization data to your configuration object.

Syntax

HRESULT Initialize(
  [in] IUnknown *punkCallbackIn,
  [in] LCID     lcidIn
);

Parameters

  • punkCallbackIn [in]
    Pointer to an IUnknown interface that can be queried for an IClusCfgCallback interface. Save this pointer for future calls to IClusCfgCallback::SendStatusReport.

  • lcidIn [in]
    The locale ID to be used for strings. Save this value for future use.

Return value

If the Initialize method successfully registers the callback function, return S_OK.

Return other HRESULT values to indicate that the call failed.

Remarks

In your implementation of Initialize, save the lcidIn and punkCallbackIn parameters as member data of your configuration object.

Examples

The following example illustrates a typical implementation of Initialize.

STDMETHODIMP CClusCfgMyResourceType::Initialize(
      IUnknown *   punkCallbackIn,
      LCID         lcidIn
    )
{
    HRESULT hr = S_OK;

    m_lcid = lcidIn;

    if ( punkCallbackIn != NULL )
    {
        IClusCfgCallback * pcccCallback = NULL;

        // Query for the IClusCfgCallback interface.
        hr = punkCallbackIn->QueryInterface( __uuidof( pcccCallback ), reinterpret_cast< void ** >( &pcccCallback ) );
        if ( SUCCEEDED( hr ) )
        {
            // Store the pointer to the IClusCfgCallback interface in the
            // member variable. Do not call pcccCallback->Release()
            m_cpcccCallback.Attach( pcccCallback );
        }
    } // if: the callback punk is not NULL

    return hr;

} //*** CClusCfgMyResourceType::Initialize()

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2003

End of server support

Windows Server 2003

IDL

ClusCfgServer.idl

IID

IID_IClusCfgInitialize is defined as 2A0EB82D-F878-492A-951E-AE000918C4A6

See also

IClusCfgCallback::SendStatusReport

IClusCfgInitialize