![]() |
Access violation when exit application |
Post Reply ![]() |
Author | |
JoseAngel ![]() Groupie ![]() Joined: 21 March 2006 Location: Spain Status: Offline Points: 35 |
![]() ![]() ![]() ![]() ![]() Posted: 21 March 2006 at 12:13pm |
With v9.81 of the library, my application (only in Release, never in Debug) generates an exception when exit.
Finally I discovered the problem is in the method STDMETHODIMP CXTPAccessible::XAccessible::QueryInterface. The method code is: STDMETHODIMP CXTPAccessible::XAccessible::QueryInterface( REFIID iid, LPVOID* ppvObj) { METHOD_PROLOGUE_EX_(CXTPAccessible, ExternalAccessible) return (HRESULT)pThis->GetAccessible()->ExternalQueryInterfac e(&iid, ppvObj); } Tracing pThis->GetAccessible(), the method call to the method CXTPAccessible::GetAccessible() with source code: CCmdTarget* CXTPAccessible::GetAccessible() { ASSERT(FALSE); return NULL; } So it means the first method finally is something like this: STDMETHODIMP CXTPAccessible::XAccessible::QueryInterface( REFIID iid, LPVOID* ppvObj) { METHOD_PROLOGUE_EX_(CXTPAccessible, ExternalAccessible) return (HRESULT)NULL->ExternalQueryInterface(&iid, ppvObj); } Maybe pThis in CXTPAccessible::XAccessible shoud be something different than CXTPAccessible (an inherited class) Is this a problem of the library or a problem of my software? Thanks. |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hello,
No, CXTPAccessible::GetAccessible never calls because it overriden in implementations: for example:
Please, try to reproduce it with some our sample.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
JoseAngel ![]() Groupie ![]() Joined: 21 March 2006 Location: Spain Status: Offline Points: 35 |
![]() ![]() ![]() ![]() ![]() |
I already found the source of error, ant it fault even with your samples.
Open your project PaneView. Edit the file PaneView.h and add in the begining of the CPaneView class definition the line in red color.... class CPaneView : public CView { CXTPControlComboBox m_wndTest; protected: // create from serialization only .... Now compile and execute in release. When you close the application, it throw an exception. |
|
![]() |
|
JoseAngel ![]() Groupie ![]() Joined: 21 March 2006 Location: Spain Status: Offline Points: 35 |
![]() ![]() ![]() ![]() ![]() |
Finally I found my error:
In CMainFrame::OnCreateControl I was assigning in lpCreateControl->pControl a stack object, not a heap one. When I change the stack control and become a pointer the application never crash when finish the application. The error was really difficult to found. Thank you. |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |