ActiveX Control optional ein/ausschalten
-
Was heißt hier "müsste"? Schau nach - und wo du dabei bist, kannst du gleich die Code-Stelle zeigen, von der aus die AfxWndProc() aufgerufen wird.
-
das projekt ist ziemlich gross und in der aufrufliste stehen sehr viele aufrufe
bevor ich danach suche ganz schnell nochmaldie tatsache das es in release einwandfrei sauber funktioniert, ist das vieleicht ein hinweis darauf das doch alles korrekt eingebunden ist?
ich such mal die codestellen..
-
Nein! Ganz und gar nicht. Nur gibt es dort den ASSERT nicht. Du kannst nicht wissen, was es für einen Schaden anrichtet, dass hier die entsprechende Routine mit einem NULL Handle aufgerufen wird....
-
hmm ok

die codestellt an der AfxWndProc() aufgerufen wird:
LRESULT CALLBACK AfxWndProcBase(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam) { AFX_MANAGE_STATE(_afxBaseModuleState.GetData()); return AfxWndProc(hWnd, nMsg, wParam, lParam); }evtl. könnte das hier weiterhelfen, nen ausschitt vom callstack:
raise(int 22) line 517 CrtMessageWindow(int 2, const char * 0x04dbb8d4 THIS_FILE, const char * 0x0012b760, const char * 0x00000000, const char * 0x0012d784) line 526 + 7 bytes _CrtDbgReport(int 2, const char * 0x04dbb8d4 THIS_FILE, int 52, const char * 0x00000000, const char * 0x00000000) line 419 + 76 bytes AfxAssertFailedLine(const char * 0x04dbb8d4 THIS_FILE, int 52) line 39 + 19 bytes CCmdTarget::~CCmdTarget() line 52 + 21 bytes COleControlSite::~COleControlSite() line 112 + 48 bytes COleControlSite::`scalar deleting destructor'(unsigned int 1) + 15 bytes COleControlContainer::~COleControlContainer() line 135 + 31 bytes CMyOleControlContainer::~CMyOleControlContainer() + 20 bytes CMyOleControlContainer::`scalar deleting destructor'(unsigned int 1) + 20 bytes CWnd::OnDestroy() line 772 + 34 bytes
-
Wa sich nur hier sehen, kann ist dass ein Fenster zersört wird und dies den ASSERT auslöst.
Hast Du dir mal jede Codeposition im Callstack angesehen?
Wer zerstört hier wann das Fenster?Hast Du hier ein Variable mit dem Fenster auf dem Stack angelegt?
Keine weiteren Infos im Callstack?
-
ich kann dir mal den komplette call stack posten meinst du das würde helfen?
-
Mach mal. Das gibt in jedem Fal mal eine Info was passiert.
-
NTDLL! 7c911230() _CrtDbgReport(int 2, const char * 0x5f4cccf0 THIS_FILE, int 365, const char * 0x00000000, const char * 0x00000000) line 353 AfxAssertFailedLine(const char * 0x5f4cccf0 THIS_FILE, int 365) line 39 + 20 bytes AfxWndProc(HWND__ * 0x000306a8, unsigned int 31, unsigned int 0, long 0) line 365 + 21 bytes AfxWndProcBase(HWND__ * 0x000306a8, unsigned int 31, unsigned int 0, long 0) line 220 + 21 bytes USER32! 7e368734() USER32! 7e368816() USER32! 7e36b4c0() USER32! 7e36b50c() NTDLL! 7c91eae3() USER32! 7e38a91e() USER32! 7e38a284() USER32! 7e3b61d3() USER32! 7e3b6278() USER32! 7e3a0617() USER32! 7e3a05cf() __crtMessageBoxA(const char * 0x00126014, const char * 0x102579a0 `string', unsigned int 73746) line 65 CrtMessageWindow(int 2, const char * 0x5f4cccf0 THIS_FILE, const char * 0x00127148, const char * 0x00000000, const char * 0x0012916c) line 520 + 22 bytes _CrtDbgReport(int 2, const char * 0x5f4cccf0 THIS_FILE, int 958, const char * 0x00000000, const char * 0x00000000) line 419 + 76 bytes AfxAssertFailedLine(const char * 0x5f4cccf0 THIS_FILE, int 958) line 39 + 20 bytes CWnd::DestroyWindow() line 958 + 21 bytes _AFX_THREAD_STATE::~_AFX_THREAD_STATE() line 67 _AFX_THREAD_STATE::`scalar deleting destructor'(unsigned int 1) + 15 bytes CThreadSlotData::DeleteValues(CThreadData * 0x00145cd0, HINSTANCE__ * 0x00000000) line 335 + 39 bytes CThreadSlotData::DeleteValues(HINSTANCE__ * 0x00000000, int 1) line 377 AfxTermLocalData(HINSTANCE__ * 0x00000000, int 1) line 474 DllMain(HINSTANCE__ * 0x5f400000, unsigned long 0, void * 0x00000001) line 546 _DllMainCRTStartup(void * 0x5f400000, unsigned long 0, void * 0x00000001) line 273 + 17 bytes NTDLL! 7c9111a7() NTDLL! 7c933f31() KERNEL32! 7c81cd76() KERNEL32! 7c81cdee() doexit(int 3, int 1, int 0) line 392 _exit(int 3) line 287 + 13 bytes raise(int 22) line 517 CrtMessageWindow(int 2, const char * 0x04dc19bc THIS_FILE, const char * 0x0012b760, const char * 0x00000000, const char * 0x0012d784) line 526 + 7 bytes _CrtDbgReport(int 2, const char * 0x04dc19bc THIS_FILE, int 52, const char * 0x00000000, const char * 0x00000000) line 419 + 76 bytes AfxAssertFailedLine(const char * 0x04dc19bc THIS_FILE, int 52) line 39 + 19 bytes CCmdTarget::~CCmdTarget() line 52 + 21 bytes COleControlSite::~COleControlSite() line 112 + 48 bytes COleControlSite::`scalar deleting destructor'(unsigned int 1) + 15 bytes COleControlContainer::~COleControlContainer() line 135 + 31 bytes CMyOleControlContainer::~CMyOleControlContainer() + 20 bytes CMyOleControlContainer::`scalar deleting destructor'(unsigned int 1) + 20 bytes CWnd::OnDestroy() line 772 + 34 bytes CLTDVBH::OnDestroy() line 1296 CWnd::OnWndMsg(unsigned int 2, unsigned int 0, long 0, long * 0x0012ea94) line 1825 CWnd::WindowProc(unsigned int 2, unsigned int 0, long 0) line 1585 + 30 bytes AfxCallWndProc(CWnd * 0x0514fcf0 {CWnd hWnd=???}, HWND__ * 0x000110c6, unsigned int 2, unsigned int 0, long 0) line 215 + 26 bytes AfxWndProc(HWND__ * 0x000110c6, unsigned int 2, unsigned int 0, long 0) line 368 USER32! 7e368734() USER32! 7e368816() USER32! 7e36b4c0() USER32! 7e36b50c() NTDLL! 7c91eae3() CPTGDlg::ReleasePTG(unsigned char 0) line 3267 CPTGDlgViewNeu::killPTG() line 713 + 27 bytes CPTGDlgViewNeu::OnDestroy() line 831 CWnd::OnWndMsg(unsigned int 2, unsigned int 0, long 0, long * 0x0012eed4) line 1825 CWnd::WindowProc(unsigned int 2, unsigned int 0, long 0) line 1585 + 30 bytes AfxCallWndProc(CWnd * 0x029a73c8 {CPTGDlgViewNeu hWnd=0x000206d8}, HWND__ * 0x000206d8, unsigned int 2, unsigned int 0, long 0) line 215 + 26 bytes AfxWndProc(HWND__ * 0x000206d8, unsigned int 2, unsigned int 0, long 0) line 368 AfxWndProcBase(HWND__ * 0x000206d8, unsigned int 2, unsigned int 0, long 0) line 220 + 21 bytes USER32! 7e368734() USER32! 7e368816() USER32! 7e36b4c0() USER32! 7e36b50c() NTDLL! 7c91eae3() USER32! 7e38f673() USER32! 7e39f74b() pfnNewWndProc(HWND__ * 0x000206a6, unsigned int 545, unsigned int 132822, long 0) line 544 + 24 bytes USER32! 7e368734() USER32! 7e368816() USER32! 7e36b89b() USER32! 7e37f3cc() CMDIChildWnd::MDIDestroy() line 938 + 85 bytes CMDIChildWnd::DestroyWindow() line 456 CDocument::OnCloseDocument() line 801 COleDocument::OnCloseDocument() line 663 CFrameWnd::OnClose() line 843 CLayoutableFrame::OnClose() line 241 CPTGDlgFrame::OnClose() line 110 CWnd::OnWndMsg(unsigned int 16, unsigned int 0, long 0, long * 0x0012f5c8) line 1825 CWnd::WindowProc(unsigned int 16, unsigned int 0, long 0) line 1585 + 30 bytes AfxCallWndProc(CWnd * 0x029a6f60 {CPTGDlgFrame hWnd=0x000206d6}, HWND__ * 0x000206d6, unsigned int 16, unsigned int 0, long 0) line 215 + 26 bytes AfxWndProc(HWND__ * 0x000206d6, unsigned int 16, unsigned int 0, long 0) line 368 AfxWndProcBase(HWND__ * 0x000206d6, unsigned int 16, unsigned int 0, long 0) line 220 + 21 bytes USER32! 7e368734() USER32! 7e368816() USER32! 7e36b4c0() USER32! 7e36b50c() NTDLL! 7c91eae3() USER32! 7e380ac5() USER32! 7e39f76c() CMDIChildWnd::DefWindowProcA(unsigned int 274, unsigned int 61536, long 18940952) line 440 CWnd::Default() line 249 CWnd::OnSysCommand(unsigned int 61536, unsigned int 61536) line 418 + 15 bytes CFrameWnd::OnSysCommand(unsigned int 61536, long 18940952) line 1046 CWnd::OnWndMsg(unsigned int 274, unsigned int 61536, long 18940952, long * 0x0012f9ec) line 1849 CWnd::WindowProc(unsigned int 274, unsigned int 61536, long 18940952) line 1585 + 30 bytes AfxCallWndProc(CWnd * 0x029a6f60 {CPTGDlgFrame hWnd=0x000206d6}, HWND__ * 0x000206d6, unsigned int 274, unsigned int 61536, long 18940952) line 215 + 26 bytes AfxWndProc(HWND__ * 0x000206d6, unsigned int 274, unsigned int 61536, long 18940952) line 368 AfxWndProcBase(HWND__ * 0x000206d6, unsigned int 274, unsigned int 61536, long 18940952) line 220 + 21 bytes USER32! 7e368734() USER32! 7e368816() USER32! 7e36b4c0() USER32! 7e36b50c() NTDLL! 7c91eae3() USER32! 7e380ac5() USER32! 7e39f76c() CMDIChildWnd::DefWindowProcA(unsigned int 161, unsigned int 20, long 18940952) line 440 CWnd::WindowProc(unsigned int 161, unsigned int 20, long 18940952) line 1586 + 26 bytes AfxCallWndProc(CWnd * 0x029a6f60 {CPTGDlgFrame hWnd=0x000206d6}, HWND__ * 0x000206d6, unsigned int 161, unsigned int 20, long 18940952) line 215 + 26 bytes AfxWndProc(HWND__ * 0x000206d6, unsigned int 161, unsigned int 20, long 18940952) line 368 AfxWndProcBase(HWND__ * 0x000206d6, unsigned int 161, unsigned int 20, long 18940952) line 220 + 21 bytes USER32! 7e368734() USER32! 7e368816() USER32! 7e3689cd() USER32! 7e3696c7() CWinThread::PumpMessage() line 853 CWinThread::Run() line 487 + 11 bytes CWinApp::Run() line 400 AfxWinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141f01, int 1) line 49 + 11 bytes WinMain(HINSTANCE__ * 0x00400000, HINSTANCE__ * 0x00000000, char * 0x00141f01, int 1) line 30 WinMainCRTStartup() line 330 + 54 bytes KERNEL32! 7c816fd7()done =P)
-
Was tut CPTGDlg::ReleasePTG(unsigned char 0) line 3267?
Kann es sein, dass der Code, der das Fenster zerstört, mehrfach aufgerufen wird?
Sieht irgendwie danach aus. Oder dass ein Handle nach dem Release nicht freigegeben wird und nochmals verwendet wird?
-
ich nehm gleich mal nen frisches leeres projekt, da passiert das auch und post dir mal dort den callstack.
gruss,
mike
-
Mir ist noch aufgefallen, das es schon crasht sobald ich nur die activeX ressource einbinde ohne wrapper klassen zuerstellen.
VLC ActiveX Control
Hat das niemand bisher gehabt? :p im Videolan forum antwortet keiner aber die usen VLC wohl auf nur fuer webbrowser..