Thread: Thread Synchronization :: Win32 API vs. MFC

  1. #1
    Registered User
    Join Date
    Nov 2001

    Thread Synchronization :: Win32 API vs. MFC


    I design and implement Windows programs using MFC and its doc/view architecture. Currently I am studying Jeffrey Richter's Programming Applications for Microsoft Windows. It is an amazing booking with unparrelled insights to Windows core.

    In his book, Richter demonstrates thread synchronization both at user-mode and at kernel object levels using Win32 API. For example, for critical sections, you can call EnterCriticalSection(...). For events, you can call CreateEvent(...).

    Anyways, I have studies from Jeff Prosise's Programming Windows with MFC. Prosise demonstrates thread synchronization using MFC tools including CCriticalSection, CEvent, CMutex, as well as CSingleLock.

    Again, I have no experience with Win32 API GUI tools. I would like to know is it what is the preferred tool for thread synchronization: Win32 API or MFC? Both techniques make use of the same thread synchronization tools. I want to know which technique is more powerful now and in the future.

    I really enjoy working with Win32 API, just not for GUI.


  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    As you have already mentioned, the MFC variants are simply wrappers around the same API routines, so essentially they are the same. If you are in any case working with MFC, use the MFC versions, if not, use the API calls directly. I do not believe there is a preffered way - it depends on the rest of the project/project team.

    I always use the API directly, for the GUI as well.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  3. #3
    Registered User
    Join Date
    Nov 2001

    I prefer Win32 API for everything except GUI. I still int the process of incorporating the Win32 API thread synchronization functions in my programs.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. API or MFC in Managed C++ (.NET)
    By gwarf420 in forum Windows Programming
    Replies: 6
    Last Post: 10-23-2008, 04:36 PM
  2. WIN32 API and Linux... *shudder
    By parad0x13 in forum C++ Programming
    Replies: 4
    Last Post: 07-24-2008, 07:27 PM
  3. Win32 API or Win32 SDK?
    By jverkoey in forum A Brief History of
    Replies: 2
    Last Post: 07-20-2005, 03:26 PM
  4. Thread Synchronization :: MFC
    By kuphryn in forum Windows Programming
    Replies: 0
    Last Post: 04-21-2002, 09:27 AM
  5. pthread api vs win32 thread api
    By Unregistered in forum Windows Programming
    Replies: 1
    Last Post: 11-20-2001, 08:55 AM