access violation com 
Author Message
 access violation com

All,

I spend couple of days on this problem. I have a MFC client which call a com
dialog & when I get out of it by clicking "cancel" it gives me memory error
saying memory could not be written.
The error does not occure while in debug mode.
Please let me know if you have any clue.

void ListView::OnManage()
{
 // Establish Com Object
 //

try{
 BeginWaitCursor();

 COleException *e = new COleException;
 if(!object){
file://creating com object
  object = new IDmManager;
  if (!object->CreateDispatch(DMMANAGE_DOCUMENT,e)) {
   AfxMessageBox("eConnector Manage could not be established.");
   object = NULL;
   EndWaitCursor();
   throw e;
   return;
  }
 }
 // Set selected r_object_id information

 DmString docId;
 docId = "xxxxxxxxx";
object->setSelected(docId);

 // call "manage" method
 EndWaitCursor();
 object->maintain();
//this call will open MFC dialogs from com class & when I will cancel them
then I get the error
  }  catch (CException *e)
   {
  CString cStr = "The MFC exception cause is:";
  TCHAR   szCause[255];
  e->GetErrorMessage(szCause,255);
  cStr = cStr + szCause;
  AfxMessageBox(cStr);
        e->Delete();
   }
return;
file://if I put a message dialog here it comes up fine
file://after that dialog memory error will be thrown

Quote:
}



Sat, 25 Oct 2003 05:51:36 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Open Connection Access Violation for ADO in ATL COM

2. NTDLL.DLL access violation in COM server only when *not* debugging

3. COM - Access violation error.

4. Access Violation with #import VB5 COM objects

5. "Access violation" accessing a DLL

6. URGENT: Access Violation when accessing the POOM IAppointment

7. Accessing COM class members when passed in to a COM class

8. access violation in

9. Access violation exception in Visual studio 7.0

10. access violation due to bad CString copy ctor when porting from VC6 to VC7 (VC++.NET)

11. VB Access Violation from C DLL

12. Access Violation.

 

 
Powered by phpBB® Forum Software