Click or drag to resize

TranslatePhysicalName

virtual CString TranslatePhysicalName(const CString& strPhysicalName) const abstract;
Parameters
strPhysicalName

[in] Physical name to be translated.

Return Value

Returns the virtual name if the translation was successful, otherwise strPhysicalName is returned.

Remarks

This function uses the physical-to-virtual name mappings created by the end user in the IVI Configuration Store. If strPhysical does not have a virtual name mapping, this function simply returns strPhysical.

Example

The following example demonstrates use of the TranslatePhysicalName function.

C++
// CoAcme4321.cpp
HRESULT Acme4321::GetChannelName(BSTR* pbstrName)
{
  HRESULT hr = S_OK;

  CString strPhysicalName = "CH1";

  // Always hand out virtual names to the user
  CString strVirtualName = TranslatePhysicalName(strPhysicalName);

  *pbstrName = strVirtualName.AllocSysString();

  return hr;
}
See Also

Download a complete CHM version of this documentation here.