MultiCam Boards Documentation > MultiCam Documentation > MultiCam User Guide > MultiCam Basics > Classes > Code Examples for Class Management > How to instantiate and delete MultiCam Surfaces

How to instantiate and delete MultiCam Surfaces

The MultiCam API functions to manage the MultiCam surfaces are:

Function

Method

McCreate

By-ident reference method

McDelete

N/A

The following code manages MultiCam surfaces:

//Connecting to driver

MCSTATUS Status = McOpenDriver(NULL);

//Instantiating a first MultiCam surface

MCHANDLE MySurface1;
MCSTATUS Status = McCreate(MC_DEFAULT_SURFACE_HANDLE, &MySurface1);

//Instantiating a second MultiCam surface

MCHANDLE MySurface2;
Status = McCreate(MC_DEFAULT_SURFACE_HANDLE, &MySurface2);

//Instantiating a third MultiCam surface

MCHANDLE MySurface3;
Status = McCreate(MC_DEFAULT_SURFACE_HANDLE, &MySurface3);

//...
//Application code
//...

//Deleting all MultiCam surfaces

Status = McDelete(MySurface1);
Status = McDelete(MySurface2);
Status = McDelete(MySurface2);

//Disconnecting from driver

Status = McCloseDriver();

The Status variable can be used for error checking.