CWnd: GetSafeHwnd



  • Hi!
    In der MSDN steht zu CWnd::GetSafeHwnd folgendes:

    Returns m_hWnd, or NULL if the this pointer is NULL.

    Meine Frage lautet jetzt: Wie kann der this-Pointer einer Klasse NULL sein?

    lg, phreaking



  • Garnicht. Aber es ist auch nirgendwo von dem this-Pointer die Rede 🙂



  • @dEUs: Verstehe ich das jetzt falsch oder was? Das hier steht in der MSDN (habe ich eh schon oben gequotet:

    Returns m_hWnd, or NULL if the this pointer is NULL.

    Und warum ist da bitte nicht vom this-Pointer die Rede? Oder verstehe ich da wirklich etwas falsch?

    so long, phreaking

    [ Dieser Beitrag wurde am 29.09.2002 um 17:23 Uhr von phreaking editiert. ]



  • Der Quellcode von CWnd::GetSafeHwnd:

    _AFXWIN_INLINE HWND CWnd::GetSafeHwnd() const
        { return this == NULL ? NULL : m_hWnd; }
    


  • hoppla, hab zu schnell gelesen 🙄 Hab das the vor this übersehen. Dachte es bezieht sich auf m_hWnd. Sorry



  • Hey ich weiß der Thread ist schon alt, aber bei mir kommt auch an der gleichen Stelle ein Assertion Failed.... das wirklich wirklich komische daran ist:

    Dieser Fehler kam nicht beim ersten Run. Aber ab jetzt kommt er jedes mal und ich habe keine Ahnung warum.
    Wurde dieses Problem irgendwie gelöst?
    Ich bekomme in folgender Zeile

    hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate,
    			pParentWnd->GetSafeHwnd(), AfxDlgProc);
    

    Folgenden Fehler /Error:

    Debug Assertion Failed!

    Program: Pfad\PowAcc.exe
    File: strex.cpp
    Line 421

    For information bla bla

    Vor allem was hat die datei strex.cpp damit zu tun?? Und warum geht der Code genau ein mal und dann überhaupt nimmer??? Auch nach Neustart nicht?

    Beste verwirrte Grüße,
    Phil



  • Was steht denn in strex.cpp an Zeile 421?



  • Hi,

    also in Zeile 421 steht folgendes

    VERIFY(_vstprintf(m_pchData, lpszFormat, argListSave) <= GetAllocLength());
    

    Es ist wirklich irre... einmal läufts und dann selbst nach Neustart nimmer.
    Was auch komisch ist, ist dass wenn ich auf Retry klicke (Abort, Retry und Cancel stehen zur Auswahl) geht's weiter im Code. Dann kommt der gleiche Fehler aber mit anderer Datei u. Zeile (strcore.cpp)... wieder auf Retry geklickt kommt dann ein Debug Error

    DAMAGE: after Normal block (#160) at 0x01072720

    .
    Dann geht's durch den Assembler Code und ich soll eine Datei auswählen. Nach dem Klick auf Cancel aber poppt dann das gewünschte Fenster auf allerdings mit einem seeh komischen Wert (Zahl) -145681600000000 (und dann soviele Nullen dass sie aus dem Fenster rausgehen quasi).

    Ich blick da wirklich nicht durch. Was könnte der Grund für die einmalige funktionalität sein??

    Besten Dank und Grüße
    Phil



  • Nur zur Info... die strex.cpp liegt bei mir in \DevStudio\VC\mfc\src , scheint also eine MFC Class zu sein.

    Und wenn ich mein Code bis zum Ende debugge (also immer wieder auf Retry klicke) steht folgendes im Debug Fenster:

    Loaded 'ntdll.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\oct1032d.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\secur32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\wsock32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\ws2_32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\ws2help.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\ctdg2032.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\octini32d.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\wfm1032d.dll', no matching symbolic information found.
    Loaded symbols for 'C:\WINDOWS\system32\MFC42D.DLL'
    Loaded symbols for 'C:\WINDOWS\system32\MSVCRTD.DLL'
    Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
    Loaded symbols for 'C:\WINDOWS\system32\MFCO42D.DLL'
    Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\mfc42loc.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\mswsock.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\dnsapi.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\winrnr.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\wldap32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\mswsock.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\winrnr.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\wldap32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\mswsock.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\rasadhlp.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\hnetcfg.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\wshtcpip.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\comctl32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\uxtheme.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\MSCTF.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\MSCTFIME.IME', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\ole32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\SSSensor.dll', no matching symbolic information found.
    memory check error at 0x010727AD = 0x30, should be 0xFD.
    memory check error at 0x010727AE = 0x30, should be 0xFD.
    memory check error at 0x010727AF = 0x30, should be 0xFD.
    memory check error at 0x010727B0 = 0x30, should be 0xFD.
    First-chance exception in PowAcc.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception.
    Loaded 'C:\WINDOWS\system32\winrnr.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\wldap32.dll', no matching symbolic information found.
    The thread 0x32C has exited with code 0 (0x0).
    The thread 0x3B0 has exited with code 0 (0x0).
    Detected memory leaks!
    Dumping objects ->
    Pfad\PowAcc.cpp(563) : {251} normal block at 0x01074260, 16 bytes long.
     Data: <                > 00 00 00 F7 FF FF 07 C0 00 00 00 F7 FF FF 07 C0 
    Pfad\PowAcc.cpp(562) : {250} normal block at 0x01074220, 16 bytes long.
     Data: < J     @     z @> 00 4A 83 0C 00 BE 92 40 00 06 C1 09 00 7A 99 40 
    Pfad\PowAcc.cpp(543) : {248} normal block at 0x010741A0, 16 bytes long.
     Data: <       @       @> 00 00 00 F7 FF FF 07 40 00 00 00 F7 FF FF 07 40 
    Pfad\PowAcc.cpp(542) : {247} normal block at 0x01074160, 16 bytes long.
     Data: < J     @     z @> 00 4A 83 0C 00 BE 92 40 00 06 C1 09 00 7A 99 40 
    Object dump complete.
    The thread 0x228 has exited with code 0 (0x0).
    The program 'Pfad\PowAcc.exe' has exited with code 0 (0x0).
    

Anmelden zum Antworten