#include <tmsmapi.h> //initialize Api pCtx = TM_Init(); //Create MSM_UofW placeholder. pUOW=MSM_CreateUOW(pCtx); //Create Event placeholder. pEndEvent = MSM_CreateWEvent(pCtx,pUOW); pEndEvent ->eventType=ENDEVENT;//set event type pEndEvent ->szTDPID=L”sampleTDPID”;//set TDPID pEndEvent ->szResourceId=L”sampleResId”;//set resourceid MSM_AddWResourceType(pCtx, pEndEvent,L”sampleResType”); //Add multi-argument resourceType pEndEvent ->szJobStep = szJobStep;//set job step status=MSM_SendWEvent(pCtx, pEndEvent);//send event MSM_FreeAndClearWEventMembers(pCtx, pEndEvent); MSM_ClearUofWMembers(pCtx,pUOW); //Free event. Do not forget to call this MSM_FreeWEvent(pCtx, pEndEvent); //Free UnitOfWork. Do not forget to call this. MSM_FreeUOW(pCtx,pUOW); //Free Context.do not forget to call this. TM_Free(pCtx);