#include <tmsmapi.h> //initialize Api pCtx = TM_Init(); //Create Event placeholder. pClearEvent= MSM_CreateWEvent(pCtx,NULL); pClearEvent->eventType=CLEAREVENT;//set event type pClearEvent->szTDPID=L”sampleTDPID”;//set TDPID pClearEvent->szResourceId=L”sampleResId”;//set resourceid MSM_AddWResourceType(pCtx, pEndEvent,L”sampleResType”); //Add multi-argument resourceType pEndEvent ->szJobStep = L”sampleJS”;//set job step pAlertEventOnProcess->iAlertCode=50;//set alert code status=MSM_SendWEvent(pCtx, pEndEvent);//send event MSM_FreeAndClearWEventMembers(pCtx, pClearEvent); //Free event. Do not forget to call this MSM_FreeWEvent(pCtx, pClearEvent); //Free Context.do not forget to call this. TM_Free(pCtx);