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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access violation when couninitializing

Status
Not open for further replies.

mjxx

Programmer
Jun 29, 2001
8
SE
Hi,

I have an application using the cdonts.dll. I use CoInitialize(NULL), pNewMail.CreateInstance and sends the mail. Everything is OK, and the mail is sent. But as I have read that you have to use CoUninitialize() at the end of the application I did so, and I get access violation. The debugger points at a Release row in comip.h:

void _Release() throw(){
if (m_pInterface != NULL) {
m_pInterface->Release(); // This row fails!
}
}

Thanks in advance for your help!
 
Solved it myself. The mail was not completely sent before couninitializing (which means that the pointer was not released), so I put {} around all the mail stuff, with the closing "}" before calling couninitialize, which solved it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top