HansDuifhuis
Programmer
Hi,
I'm using the iMsg interface in 'OnDelivery' event sink on an SMTP MCIS server. I have no problem extracting eg. the current recipient using:
HRESULT STDMETHODCALLTYPE CSmtpAdd::OnDelivery(IMsg *pMsg)
{
char szRecipient[MAX_RECIPIENT];
VARIANT szRCPT_TOs;
DWORD cbSize = 0;
....
cbSize = sizeof(szRecipient);
pMsg->GetStringA("current rcpt", &cbSize, szRecipient);
....
But I'm having difficulties using the following:
VariantInit(&szRCPT_TOs);
pMsg->GetVariantA("rcpt to", &szRCPT_TOs);
It compiles nicely, but gives an unspecified (E_FAIL) error at runtime.
Can anyone help me please? I'm not used to working with VARIANT's...
Hans.
I'm using the iMsg interface in 'OnDelivery' event sink on an SMTP MCIS server. I have no problem extracting eg. the current recipient using:
HRESULT STDMETHODCALLTYPE CSmtpAdd::OnDelivery(IMsg *pMsg)
{
char szRecipient[MAX_RECIPIENT];
VARIANT szRCPT_TOs;
DWORD cbSize = 0;
....
cbSize = sizeof(szRecipient);
pMsg->GetStringA("current rcpt", &cbSize, szRecipient);
....
But I'm having difficulties using the following:
VariantInit(&szRCPT_TOs);
pMsg->GetVariantA("rcpt to", &szRCPT_TOs);
It compiles nicely, but gives an unspecified (E_FAIL) error at runtime.
Can anyone help me please? I'm not used to working with VARIANT's...
Hans.