Skip to content

GetIMessagePointer

Retrieves an IMessage pointer from the VISA-COM I/O session.

virtual HRESULT GetIMessagePointer(IMessage** ppMessage) override;

ppMessage

[out] IMessage pointer.

Returns S_OK if successful, otherwise a failure HRESULT.

This function returns an IMessage pointer to the current VISA-COM I/O session. This can be useful for accessing VISA-COM functionality not directly exposed in the Nimbus Template Library. Also, the IMessage pointer can be passed out of the driver to the client application so that end users can directly manipulate aspects of the I/O session.

The following example demonstrates use of the GetIMessagePointer function.

CoAcme4321.cpp
HRESULT Acme4321::OnFinalInitialize()
{
HRESULT hr = S_OK;
CComPtr<IMessage> spMessage;
hr = io.DirectIo.GetIMessagePointer(&spMessage);
// Note that the CComPtr smart pointer class automatically calls release when the function exits
return hr;
}