S
Scott T
Hello all,
I have some code which runs successfully on 2 W2k professional boxes,
running both Office 2000 (SP3) and Office 2002 (SP4). But when the
same code is run on a W2k server (Office 2002 SP4, Exchange 2000) it
generates an exception in the import call. I have downloaded and tried
the latest redemption dll (282) and still the same result. I have also
recompiled exe on the target machine. The W2k pro machine running
office 2002 (SP4) had OFFICE 2000 installed previously and so uses the
#import "\Program Files\Microsoft Office\Office\MSOUTL9.olb"
rename_namespace("Outlook"), named_guids, raw_interfaces_only
using namespace Outlook;
statement rather than the
#import "\Program Files\Microsoft Office\Office10\MSOUTL.olb"
rename_namespace("Outlook"), named_guids, raw_interfaces_only
statement used on the W2k server.
I have remove error checking and code irrelevant to the question .
filename and path are valid.
_ApplicationPtr pApp = NULL;
pApp.CreateInstance(__uuidof(Application));
_NameSpacePtr pNameSpace;
pApp->get_Session(&pNameSpace);
MAPIFolderPtr pFolder;
pNameSpace->GetDefaultFolder(Outlook:lFolderDrafts, &pFolder);
_ItemsPtr pItems;
pFolder->get_Items(&pItems);
CComVariant var(6);
IDispatchPtr pDispPtr;
pItems->Add(var, &pDispPtr);
// create Redemption object
ISafeMailItemPtr itemPtr1;
hr = itemPtr1.CreateInstance(__uuidof(SafeMailItem));
itemPtr1->Item = pDispPtr;
CComBSTR fileName(CService::m_WorkingDir);
fileName.Append(_T("*.msg"));
if((hFindFile = FindFirstFile(fileName, &fileData))!=
INVALID_HANDLE_VALUE)
{
CComBSTR msgFileName(CService::m_WorkingDir);
msgFileName.Append((LPCTSTR) fileData.cFileName);
_bstr_t fname(msgFileName);
// load msg file in redemption obj
---> itemPtr1->Import(fname, 3);
Microsoft C++ Exception generated from the Import call
First-chance exception in SMService.exe (KERNEL32.DLL): 0xE06D7363:
Microsoft C++ Exception.
I have attached the output from the debug paine of MSDev 6 restricted
to the exception.
I did try creating an instance MAPIUtils before creating the
ISafeMailItemPtr instance as documented on redemption web site but to
no avail. Could anyone advise me of any possible leads to resolve this
problem as I have no more ideas and I do need to run on W2K Server.
Is it my code, the W2K OS, support applications (office, MAPI) or is
it a redemption issue.
Any help would be much appreciated.
regards and thanks in advance
S.
I have some code which runs successfully on 2 W2k professional boxes,
running both Office 2000 (SP3) and Office 2002 (SP4). But when the
same code is run on a W2k server (Office 2002 SP4, Exchange 2000) it
generates an exception in the import call. I have downloaded and tried
the latest redemption dll (282) and still the same result. I have also
recompiled exe on the target machine. The W2k pro machine running
office 2002 (SP4) had OFFICE 2000 installed previously and so uses the
#import "\Program Files\Microsoft Office\Office\MSOUTL9.olb"
rename_namespace("Outlook"), named_guids, raw_interfaces_only
using namespace Outlook;
statement rather than the
#import "\Program Files\Microsoft Office\Office10\MSOUTL.olb"
rename_namespace("Outlook"), named_guids, raw_interfaces_only
statement used on the W2k server.
I have remove error checking and code irrelevant to the question .
filename and path are valid.
_ApplicationPtr pApp = NULL;
pApp.CreateInstance(__uuidof(Application));
_NameSpacePtr pNameSpace;
pApp->get_Session(&pNameSpace);
MAPIFolderPtr pFolder;
pNameSpace->GetDefaultFolder(Outlook:lFolderDrafts, &pFolder);
_ItemsPtr pItems;
pFolder->get_Items(&pItems);
CComVariant var(6);
IDispatchPtr pDispPtr;
pItems->Add(var, &pDispPtr);
// create Redemption object
ISafeMailItemPtr itemPtr1;
hr = itemPtr1.CreateInstance(__uuidof(SafeMailItem));
itemPtr1->Item = pDispPtr;
CComBSTR fileName(CService::m_WorkingDir);
fileName.Append(_T("*.msg"));
if((hFindFile = FindFirstFile(fileName, &fileData))!=
INVALID_HANDLE_VALUE)
{
CComBSTR msgFileName(CService::m_WorkingDir);
msgFileName.Append((LPCTSTR) fileData.cFileName);
_bstr_t fname(msgFileName);
// load msg file in redemption obj
---> itemPtr1->Import(fname, 3);
Microsoft C++ Exception generated from the Import call
First-chance exception in SMService.exe (KERNEL32.DLL): 0xE06D7363:
Microsoft C++ Exception.
I have attached the output from the debug paine of MSDev 6 restricted
to the exception.
I did try creating an instance MAPIUtils before creating the
ISafeMailItemPtr instance as documented on redemption web site but to
no avail. Could anyone advise me of any possible leads to resolve this
problem as I have no more ideas and I do need to run on W2K Server.
Is it my code, the W2K OS, support applications (office, MAPI) or is
it a redemption issue.
Any help would be much appreciated.
regards and thanks in advance
S.