Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RichEditView error when closing VC.Net app

Status
Not open for further replies.

BlackDice

Programmer
Mar 1, 2004
257
0
0
US
I have an app that I recently ported to .Net (an SDI app with Richedit as the view type). Everything is working fine and it runs fine with native and managed code mixed. But when I close the app, I get this error message:
===================================================
An unhandled exception of type 'System.NullReferenceException' occurred in FB.exe

Additional information: Object reference not set to an instance of an object.

====================================================
this is happening in the following procedure, which I have never touched. (the offending line is pointed out)



CRichEditCntrItem* CRichEditView::GetInPlaceActiveItem() const
{
ASSERT(m_lpRichEditOle != NULL);
CRichEditDoc* pDoc = GetDocument();
CRichEditCntrItem* pItem = NULL;

CReObject reo;
HRESULT hr = m_lpRichEditOle->GetObject(REO_IOB_SELECTION, &reo,
REO_GETOBJ_ALL_INTERFACES);
//reo's interfaces are all in UNICODE
if (GetScode(hr) == S_OK && (reo.dwFlags & REO_INPLACEACTIVE))
{
pItem = pDoc->LookupItem(reo.poleobj);
if (pItem == NULL)
pItem = pDoc->CreateClientItem(&reo);
ASSERT(pItem != NULL);
}
return pItem;
} --------------------------------------------------------------------------------


I hope anyone can help me. Thanks

bdiamond
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top