richp
asked on
ActiveX/COM Problem
I'm creating a chartfx component in a in proc com server:
m_Chart.Create("ChartFx", WS_VISIBLE | WS_CHILD | WS_BORDER, aRect, this, IDR_CHART1);
m_Chart.SetType(SCATTER | CT_TRACKMOUSE | CT_COLORLINE | CT_PAINTMARKER | CT_TOOL);
m_Chart.SetWindowPos(0, 0, 0, aRect.Width(), aRect.Height(), SWP_NOMOVE | SWP_NOZORDER);
when I close the app, here's the call stack:
NTDLL! 77f76148()
NTDLL! 77f8a8b9()
NTDLL! 77f83209()
KERNEL32! 77f11ad0()
CFX32! 0277c496()
USER32! 77e71ab7()
USER32! 77e71a77()
NTDLL! 77f7624f()
CFX32! 02771c05()
COleDispatchDriver::~COleD ispatchDri ver() line 80 + 15 bytes
COleControlSite::~COleCont rolSite() line 99 + 33 bytes
COleControlSite::`scalar deleting destructor'(unsigned int 1) + 15 bytes
COleControlContainer::~COl eControlCo ntainer() line 120 + 31 bytes
COleControlContainer::`sca lar deleting destructor'(unsigned int 1) + 15 bytes
CWnd::OnDestroy() line 764 + 34 bytes
CWnd::OnWndMsg(unsigned int 2, unsigned int 0, long 0, long * 0x0012f678) line 1815
CWnd::WindowProc(unsigned int 2, unsigned int 0, long 0) line 1575 + 30 bytes
When I QueryInterface I do a Release so the reference count should be 1.
I'm doing the same with formula1 and have no problems.
Anyone know why the ReleaseDispatch() is being called before any of the destructor methods?
m_Chart.Create("ChartFx", WS_VISIBLE | WS_CHILD | WS_BORDER, aRect, this, IDR_CHART1);
m_Chart.SetType(SCATTER | CT_TRACKMOUSE | CT_COLORLINE | CT_PAINTMARKER | CT_TOOL);
m_Chart.SetWindowPos(0, 0, 0, aRect.Width(), aRect.Height(), SWP_NOMOVE | SWP_NOZORDER);
when I close the app, here's the call stack:
NTDLL! 77f76148()
NTDLL! 77f8a8b9()
NTDLL! 77f83209()
KERNEL32! 77f11ad0()
CFX32! 0277c496()
USER32! 77e71ab7()
USER32! 77e71a77()
NTDLL! 77f7624f()
CFX32! 02771c05()
COleDispatchDriver::~COleD
COleControlSite::~COleCont
COleControlSite::`scalar deleting destructor'(unsigned int 1) + 15 bytes
COleControlContainer::~COl
COleControlContainer::`sca
CWnd::OnDestroy() line 764 + 34 bytes
CWnd::OnWndMsg(unsigned int 2, unsigned int 0, long 0, long * 0x0012f678) line 1815
CWnd::WindowProc(unsigned int 2, unsigned int 0, long 0) line 1575 + 30 bytes
When I QueryInterface I do a Release so the reference count should be 1.
I'm doing the same with formula1 and have no problems.
Anyone know why the ReleaseDispatch() is being called before any of the destructor methods?
When you do a QueryInterface(), which interface do you release?
ASKER
m_pVolSurf = GetETSControl(lpUnk, &lpContext);
lpContext->Release();
....
VolSurface * CVolatilityCtl::GetETSCont rol( IUnknown* pUnk, ISnapInMarketSet** ppETSCtrl)
{
_ASSERTE(pUnk);
if (!pUnk || pUnk->QueryInterface(IID_I MarketSet_ SnapIn, (LPVOID*) ppETSCtrl) != S_OK)
return NULL;
lpContext->Release();
....
VolSurface * CVolatilityCtl::GetETSCont
{
_ASSERTE(pUnk);
if (!pUnk || pUnk->QueryInterface(IID_I
return NULL;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.