IDirectMusicPerformance::AddPort

The IDirectMusicPerformance::AddPort method assigns a port to the performance.

HRESULT AddPort(
  IDirectMusicPort* pPort
);
 

Parameters

pPort
Port to add. If NULL, the default port is added. See Remarks.

Return Values

If the method succeeds, the return value is S_OK.

If it fails, the method may return one of the following error values:

DMUS_E_NOT_INIT
DMUS_E_CANNOT_OPEN_PORT
E_OUTOFMEMORY
E_POINTER

Remarks

If you wish to pass NULL to this method, you must first pass NULL to IDirectMusicPerformance::Init.

When the default port is specified by passing NULL in pPort, it is assigned one channel group, and if no PChannels have been set up for any other port, PChannels 0-15 are assigned to MIDI channels 0-15.

If pPort is not NULL, the port must be activated by a call to IDirectMusicPort::Activate, and a block of channels must be assigned by a call to IDirectMusicPerformance::AssignPChannelBlock.

This method creates a reference to IDirectMusicPort that is released by IDirectMusicPerformance::RemovePort or IDirectMusicPerformance::CloseDown.

QuickInfo

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in dmusici.h.

See Also

IDirectMusicPerformance::RemovePort, Default Port