I'm new to Exchange development. I'm not able to register for
Asynchronous event.

I've implemented OnMessageSubmission, just puuing some text to a file.

//Here is the code
STDMETHODIMP CSink1::OnMessageSubmission(IMailMsgProperties*
pMailMsg,IMailTransportNotify* pINotify,PVOID pvNotifyContext)
{

CComBSTR bstrMsgText;
HANDLE hFile;
ULONG nSizeWritten = 0 ;
HRESULT hr = S_OK;
try
{
LPCWSTR szFilename = L"c:\\events1.txt";


hFile = CreateFileW(szFilename,
FILE_APPEND_DATA,
FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
NULL,
OPEN_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL);
if(hFile == INVALID_HANDLE_VALUE)
return E_POINTER;

int nBufSize = 0;
BOOL fRC = FALSE;
CComBSTR bstrSubject= "Subject:";
nBufSize = lstrlenW(bstrSubject);
fRC = WriteFile(hFile,bstrSubject,nBufSize*2,&nSizeWritten,NULL);
if(fRC == FALSE)
return S_FALSE;
}
catch(...)
{
bstrMsgText.Append(_T(" IN CATCH "));
WriteFile(hFile,bstrMsgText,bstrMsgText.Length()*2,&nSizeWritten,NULL);
}
CloseHandle(hFile);
return hr;
}

but when i tries to register the Synchronouus event by using command:
cscript smtpreg.vbs /add 1 OnTrasportSubmission TSink1
TSubmission.Sink1 "mail from=*"

Rule line is commented in the smtppreg.vbs [ so to receive events from
any clients]

But it shows error:

Binding Display Name Specified: TSink1
COM Category (EventType) is not registered...
Running ResetSMTPCatIDs...one moment
** ERROR **
Error registering COM categories
0

Make sure the SMTP Service is installed on the machine.

Can anybosy please help me on this. Why this error is shown, where i'm
wrong.