It may be necessary to call m_Application->Quit().
If m_application is the only reference. It should close when refcount goes
to zero. That of course depends upon the implementation of the
implementation but I would expect this to be the default behavior. In
addition, OP should not close the app because there could be other clients
which may want the app open.
---
Ajay
"Alexander Grigoriev" <alegr@earthlink.net> wrote in message
news:%23n$4MfQYIHA.3556@TK2MSFTNGP02.phx.gbl...
I think you have to signal the application object to exit, otherwise it
will just be hanging around.
"AndersG" <gustafsson.anders@gmail.com> wrote in message
news:ea1a7b43-af9e-4f55-8fe3-8b172b7f2575@s12g2000prg.googlegroups.com...
Thanks Joe, basically what I do is:
hr = m_Application.CreateInstance("CrystalRuntime.Application");
m_Report = m_Application->OpenReport(ReportPath, dummy);
job->PrintOut(vPromptUser, vnCopies, dummy, dummy, dummy);
if(m_Report!=NULL) m_Report->Release();
if (m_Application != NULL) m_Application.Release();
So I assume that I release all that I have grabbed? Is there a way to
see what my referece cont is? If I look at the program with
ProcessExplorer I see the viewer being loaded first time it is used,
but it does not unload even after being released. Also, the leak only
happens when I either preview on screen or export to PDF. If I just
print, then there is no leak. I have leak detection enabled on my
project so I assume that I would see any leaks that I cause, but not
leaks in loaded DLLs.