MFC klassen in Win32 nutzen



  • Also ich habe eine Win32 Anwendung, möchte da aber die klassen CStdioFile und CString nutzen wenn ich nun den header:#include <afxext.h> // MFC-Erweiterungen includiere kann ich zwar kompilieren aber wenn ich starten will sagt er folgende fehlermeldung:
    nafxcwd.lib(thrdcore.obj) : error LNK2001: Nichtaufgeloestes externes Symbol __endthreadex
    nafxcwd.lib(thrdcore.obj) : error LNK2001: Nichtaufgeloestes externes Symbol __beginthreadex
    Debug/OpenGL Tut3.exe : fatal error LNK1120: 2 unaufgeloeste externe Verweise

    was möchte er von mir????



  • _endthreadex und _beginthreadex haben meiner Meinung nach nichts mit der afxext.h zu tun. Hier mal ein Auszug aus der MSDN zu _endthreadex, vielleicht hilft dir das ja:

    Required Header: <process.h>
    Compatibility: Win 95, Win NT

    Libraries

    LIBCMT.LIB Multithread static library, retail version
    MSVCRT.LIB Import library for MSVCRT.DLL, retail version

    Note For an executable file linked with LIBCMT.LIB, do not call the Win32ExitThread API; this prevents the run-time system from reclaiming allocated resources. _endthread and _endthreadex reclaim allocated thread resources and then call ExitThread.

    _endthread automatically closes the thread handle. (This behavior differs from the Win32 ExitThread API.) Therefore, when you use _beginthread and _endthread, do not explicitly close the thread handle by calling the Win32CloseHandle API.

    Like the Win32 ExitThread API, _endthreadex does not close the thread handle. Therefore, when you use _beginthreadex and _endthreadex, you must close the thread handle by calling the Win32 CloseHandle API.

    Example

    /* BEGTHRD.C illustrates multiple threads using functions:
    *
    * _beginthread _endthread
    *
    *
    * This program requires the multithreaded library. For example,
    * compile with the following command line:
    * CL /MT /D "_X86_" BEGTHRD.C
    *
    * If you are using the Visual C++ development environment, select the
    * Multi-Threaded runtime library in the compiler Project Options dialog
    * box.
    *
    */



  • xyz44 schrieb:

    was möchte er von mir????

    Alt+F7 -> Allgemein -> MFC -> MFC in einer (...) verwenden.


Anmelden zum Antworten