Help with Unhandled Exception in Outlook Add-in

M

MikeJohnson

Please help me determine the cause of an unhandled exception
in my C++-based Outlook add-in.
I am using C++ smart pointers, as generated in "msoutli.tli".

I get:
"Unhandled Exception C0000005 Access Violation reading 007500b6"


Here is the C++ generated source, from "msoutl.tli":

inline HRESULT Attachment::SaveAsFile ( _bstr_t Path ) {
HRESULT _hr = raw_SaveAsFile(Path);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _hr;
}

The crash is occurring in raw_SaveAsFile.

Here is the disassembly of the line where the exception occurs:

HRESULT _hr = raw_SaveAsFile(Path);
0745456F lea ecx,[Path]
07454572 call _bstr_t::eek:perator unsigned short * (7417CA8h)
07454577 mov esi,esp
07454579 push eax
0745457A mov eax,dword ptr [this]
0745457D mov ecx,dword ptr [eax]
0745457F mov edx,dword ptr [this]
07454582 push edx
07454583 call dword ptr [ecx+54h]

My Path variable looks okay, I think:

m_Data: 0x074d84b0
{
m_wstr=0x00203604 "C:\Program Files\as\Backup\Deleted
Items\filename.txt"
m_mstr=0x00000000 <Bad Ptr>
m_RefCount: 2
}


The "call dword ptr [ecx+54h]" is causing the unhandled exception,
because ecx + 54h = 007500b6 (the address that can't be accesssed).

Why is the target of the call messed up?

FYI,
here is the rest of the disassembly of "HRESULT _hr =
raw_SaveAsFile(Path);",
after the call dword ptr[ecx+54h]:

07454586 cmp esi,esp
07454588 call @ILT+5875(__RTC_CheckEsp) (74186F8h)
0745458D mov dword ptr [_hr],eax


Thanks very very much for any assistance!!

I will leave the debugger open,
in case more information would be helpful.

Thank you,
Mike
 
A

ASP.Confused

In C++, wouldn't the back-slash characters be encoded? So if you have
"c:\temp.txt" it would be "c:\\temp.txt".

As I only develop in .NET for my add-ins, I don't know if this would do
anything.

ASP.Confused
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top