stdinc.h

来自「VC++串口通信设。本书详细说明讲解了在VC++环境下编写串口通信得过程。值得一」· C头文件 代码 · 共 106 行

H
106
字号
#ifndef STDINC_H
#define STDINC_H


//
// Visual C++ has cannot manage debug infor for symbols greater than 255
// characters. However, it is easy to have symbol lengths greater than 255 
// when using the STL. Therefore, I'm disabling this warning here.
//
#pragma warning(disable: 4786)


//
// This is, after all, a book about DCOM...
//
#define _WIN32_DCOM


//
// If either of the ATL flags are set, then we're using ATL (duh!)
//
#ifdef USE_ATL
   #error Please specify USE_ATL_INPROC or USE_ATL_LOCAL to indicate your project uses ATL
#endif
#ifdef USE_ATL_INPROC
   #define USE_ATL
#endif
#ifdef USE_ATL_LOCAL
   #define USE_ATL
#endif


//
// Are console operations available?
//
#ifdef USE_MFC
   #define NO_CONSOLE
#endif
#ifdef USE_ATL
   // Not strictly true, of course
   #define NO_CONSOLE
#endif


//
// We ARE using MFC
//
#ifdef USE_MFC
   #include <afxwin.h>
   #include <afxcmn.h>
   #include <afxext.h>
   #include <afxdisp.h>
   #include <cguid.h>
   #include <afxctl.h>
   #include <afxtempl.h>
   #include <afxdlgs.h>


//
// We are not using MFC
//
#else USE_MFC

   //
   // Get basic Windows stuff
   //
   #define STRICT
   #ifndef NO_INC_OLE2
      #define INC_OLE2
      #include <windows.h>
      #include <ole2.h>
   #else
      #include <windows.h>
   #endif
   #include <cguid.h>

#endif


//
// We ARE using ATL
//
#ifdef USE_ATL
   // #define _WIN32_WINNT 0x0400
   #define _ATL_APARTMENT_THREADED
   #include <atlbase.h>

   // What is our module class? This is a utility header, it should
   // be found in the same diredctory as this file
   #include "atlmod.h"

   #include <atlcom.h>
#endif


// Some helpful type aliases
typedef PVOID*          PPVOID;
typedef unsigned char   UCHAR;
typedef unsigned char*  PUCHAR;
typedef unsigned short  USHORT;
typedef unsigned short* PUSHORT;
typedef unsigned long   ULONG;
typedef unsigned long*  PULONG;
typedef BSTR*           PBSTR;

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?