View Single Post

  #5 (permalink)  
Old 05-12-2005
Anonymous Anonymous is offline
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
My response is related with COM exception ( 0xC0000005 )...

My response is related with COM exception ( 0xC0000005 ) at the end of execution MapPoint test application described in article ( Part 1 )...

Unhandled exception 0xC0000005 "Access Violation" happens because:

- all your COM objects were released after g_pMapPoint->Quit() was executed;

- but, pointers to COM objects you worked with are still NOT NULL.

You can fix it in a very simple way:

...
myMapPtr->Saved = true;

try
{
if( g_pMapPoint != NULL )
{
g_pMapPoint->Quit();
}
}
catch( ... ){}

resultsPtr = NULL;
locAddressPtr = NULL;
pinAddressPtr = NULL;
myMapPtr = NULL;
g_pMapPoint = NULL;

CoUninitialize();
}

I tested it and everything is fine now.

Best regards,
Sergey
Reply With Quote