Friday, March 19, 2021

_SECURE_ATL macro

_SECURE_ATL macro

I see this statement in a header file:

#ifndef _SECURE_ATL
#define _SECURE_ATL 1
#endif

  1. _SECURE_ATL deprecated?
  2. I broke out an old development system and found that _SECURE_ATL was used in the version of ATL that shipped with VS2005. It seemed to be related to the old _ATL_MIN_CRT option.

    It came with the VS2005 when creating a new MFC Application Multi document / View with the Wizard.

    I would feel comfortable deleting _SECURE_ATL in my own my project if my code did not reference it and it was not referenced by the current version ATL/MFC headers that would be used in the build process.

  3. Predefined macros
  4. The Microsoft C/C++ compiler (MSVC) predefines certain preprocessor macros, depending on the language (C or C++), the compilation target, and the chosen compiler options.

    MSVC supports the predefined preprocessor macros required by the ANSI/ISO C99, C11, and C17 standards, and the ISO C++14 and C++17 standards. The implementation also supports several more Microsoft-specific preprocessor macros. Some macros are defined only for specific build environments or compiler options. Except where noted, the macros are defined throughout a translation unit as if they were specified as /D compiler option arguments. When defined, the macros are expanded to the specified values by the preprocessor before compilation. The predefined macros take no arguments and can't be redefined.

    No preprocessor macros that identify the ATL or MFC library version are predefined by the compiler. ATL and MFC library headers define these version macros internally. They're undefined in preprocessor directives made before the required header is included.

    1. _ATL_VER Defined in <atldef.h > as an integer literal that encodes the ATL version number.
    2. _MFC_VER Defined in <afxver_.h > as an integer literal that encodes the MFC version number.

  5. List of _MSC_VER and _MSC_FULL_VER/a>
  6. Visual Studio version and discrimination macros.

  7. Microsoft Foundation Class Library
  8. MFC can be used by linking a static library or by adding the MFC DLL..

  9. MFC Library Versions
  10. The MFC Library is available in versions that support ANSI single-byte and multibyte character set (MBCS) code, as well as versions that support Unicode (encoded as UTF-16LE, the Windows-native character set). Each MFC version is available as a static library or as a shared DLL. There is also a smaller MFC static library version that leaves out MFC controls for dialogs, for applications that are very sensitive to size and don't need those controls. The MFC libraries are available in both debug and release versions for supported architectures that include x86, x64, and ARM processors. You can create both applications (.exe files) and DLLs with any version of the MFC libraries. There is also a set of MFC libraries compiled for interfacing with managed code. The MFC shared DLLs include a version number to indicate library binary compatibility.

  11. Window Objects
  12. MFC supplies class CWnd to encapsulate the HWND handle of a window. The CWnd object is a C++ window object, distinct from the HWND that represents a Windows window but containing it. Use CWnd to derive your own child window classes, or use one of the many MFC classes derived from CWnd. Class CWnd is the base class for all windows, including frame windows, dialog boxes, child windows, controls, and control bars such as toolbars. A good understanding of the relationship between a C++ window object and an HWND is crucial for effective programming with MFC.

    MFC provides some default functionality and management of windows, but you can derive your own class from CWnd and use its member functions to customize the provided functionality. You can create child windows by constructing a CWnd object and calling its Create member function, then customize the child windows using CWnd member functions. You can embed objects derived from CView, such as form views or tree views, in a frame window. And you can support multiple views of your documents via splitter panes, supplied by class CSplitterWnd.

No comments:

Post a Comment