windows api 库 和 判断编译器类型

  • 编译器特征

windows api 库 和 判断编译器类型_第1张图片

一般情况下,有如下编译器特征:
This program must be run under Win32是Borland系编译器标志(BCB、delphi)
This program cannot be run in DOS mode+rich signature是微软系编译器标志(VC、MASM)
This program cannot be run in DOS mode无rich signature是gcc编译器标志。
 

  • VC不同链接需要的库(VC2010为例)

命名规则 libc [p][mt][d].lib
p: C Plusplus 
mt: Multi-Thread
d:debug

windows api 库 和 判断编译器类型_第2张图片

版本对应关系
msvcr80-vc2005
msvcr90-vc2008
msvcr100-vc2010
msvcr110-vc2012
msvcr120-vc2015

  • Visual studio 设置如何链接C运行库和C++运行库 

如果设置成了动态链接,则打包时需要把运行库msvcr100.dll和msvcp100.dll都打包,以防止部署到某个计算机上,而那台计算机缺少对应的运行库,而运行不了
如果设置成了静态链接,则不存在这个问题

windows api 库 和 判断编译器类型_第3张图片

  • Visual studio 设置如何链接MFC 
    如果设置成了动态链接,则打包时需要把运行库mfc100.dll都打包,以防止部署到某个计算机上,而那台计算机缺少对应的运行库,而运行不了
    如果设置成了静态链接,则不存在这个问题

windows api 库 和 判断编译器类型_第4张图片

 

  • windows操作系统的调用层次

windows api 库 和 判断编译器类型_第5张图片

①ntoskrnl.exe相当于linux下的uImage,即内核镜像。
②user32.dll kernel32.dll gdi32.dll 是三大核心WIN32 API组件
③ntdll.dll 是NATIVE API

kernel32.dll 创建线程等
gdi32.dll 绘图
user32.dll 比如创建窗口、发送消息等,会用到gdi32.dll的绘图功能

KERNEL32.DLL
KERNEL32.DLL exposes to applications most of the Win32 base APIs, such as memory management, input/output (I/O) operations, process and thread creation, and synchronization functions. Many of these are implemented within KERNEL32.DLL by calling corresponding functions in the native API, exposed by NTDLL.DLL.[7][failed verification]

GDI32.DLL
GDI32.DLL exports Graphics Device Interface (GDI) functions that perform primitive drawing functions for output to video displays and printers. It is used, for example, in the XP version of Paint. Applications call GDI functions directly to perform low-level drawing (line, rectangle, ellipse), text output, font management, and similar functions.[7][8]

Initially, GDI supported 16 and 256 color EGA/VGA display cards and monochrome printers. The functionality has expanded over the years, and now includes support for things like TrueType fonts, alpha channels, and multiple monitors.[9]

USER32.DLL
Further information: Windows USER
USER32.DLL implements the Windows USER component that creates and manipulates the standard elements of the Windows user interface, such as the desktop, windows, and menus. It thus enables programs to implement a graphical user interface (GUI) that matches the Windows look and feel. Programs call functions from Windows USER to perform operations such as creating and managing windows, receiving window messages (which are mostly user input such as mouse and keyboard events, but also notifications from the operating system), displaying text in a window, and displaying message boxes.

Many of the functions in USER32.DLL call upon GDI functions exported by GDI32.DLL to do the actual rendering of the various elements of the user interface. Some types of programs will also call GDI functions directly to perform lower-level drawing operations within a window previously created via USER32 functions.

COMCTL32.DLL
COMCTL32.DLL implements a wide variety of standard Windows controls, such as File Open, Save, and Save As dialogs, progress bars, and list views. It calls functions from both USER32.DLL and GDI32.DLL to create and manage the windows for these UI elements, place various graphic elements within them, and collect user input.

COMDLG32.DLL
COMDLG32.DLL, the Common Dialog Box Library, implements a wide variety of Windows dialog boxes intended to perform what Microsoft deems 'common application tasks'. Starting with the release of Windows Vista, Microsoft considers the "Open" and "Save as" dialog boxes provided by this library as deprecated and replaced by the 'Common Item Dialog API'.[10]

WS2_32.DLL
WS2_32.DLL implements the Winsock API, which provides TCP/IP networking functions and provides partial, broken compatibility with other network APIs. wsock.dll and wsock32.dll are older versions for Win3.11 and Win95 compatibility.
WSOCK32.dll 调用的是WS2_32.DLL,实现了CSocket

ADVAPI32.DLL
ADVAPI32.DLL provides security calls and functions for manipulating the Windows Registry.

NETAPI32.DLL
NETAPI32.DLL provides functions for querying and managing network interfaces.

OLE32.DLL
OLE32.DLL provides the Component Object Model, as well as Object Linking and Embedding.
 

SHSCRAP.DLL
SHSCRAP.DLL is part of the Object Linking and Embedding (OLE) mechanism. It implements support for shell scrap files, which are automatically created when you drag selected content from an OLE-capable application into an Explorer window or desktop,[11] but you can also use the Object Packager to create them. They can then be dragged into another OLE-capable application.

This functionality was removed from Windows Vista (and therefore later versions) to improve security and rid the operating system of generally unused functionality.[12] Scrap (.shs) files have been used by viruses because they can contain a wide variety of files (including executable code), and the file extension is not shown even when "Hide file extensions from known file types" is disabled.[13] The functionality can be restored by copying registry entries and the DLL from a Windows XP system.[14]

WINMM.DLL
WINMM.DLL provides access to the original WinMM audio API.

IMM32.DLL
IMM32 is responsible for invoking and interacting with the Input Method Editor.

  • 关于NT

Windows NT是基于OS/2 NT的基础编制的。OS/2是由微软和IBM联合研制,分为微软的Microsoft OS/2 NT与IBM的IBM OS/2。协作后来不欢而散,IBM继续向市场提供先前的OS/2版本,而微软则把自己的OS/2 NT的名称改为Windows NT,即第一代的Windows NT 3.1。Windows NT是纯32位操作系统,采用先进的NT核心技术。NT即新技术(New Technology)。
Windows NT包括两个版本,分别是Windows NT Workstation 和Windows NT Server 。Windows NT Workstation的设计目标是工作站操作系统,适用于交互式桌面环境;Windows NT Server的设计目标是企业级的网络操作系统,提供容易管理、反应迅速的网络环境。两者在系统结构上完全一样,只是为适应不同应用环境在运行效率上做相应调整。Windows NT Server具有更多的高级功能,可把Windows NT Workstation 看作它的子集。

Windows NT的主要版本
Microsoft Windows NT 3.1 (1993)
Microsoft Windows NT 3.5 (1994)
Microsoft Windows NT 3.51 (1995)
Microsoft Windows NT 4.0 (1996)

从5.0版开始,Windows NT只是简单地称为Windows了,下面的版本是后来的版本:
Microsoft Windows 2000 (Windows NT 5.0) (1999)
Microsoft Windows XP (Windows NT 5.1) (2001)
Microsoft Windows Server 2003 (Windows NT 5.2) (2003)
Microsoft Windows Vista (Windows NT 6.0) (2006)
Microsoft Windows Server 2008 (Windows NT 6.1) (2008)
Microsoft Windows 7 (Windows NT 7.0) (2010)

  • 关于GDI和DIRECTX

    windows api 库 和 判断编译器类型_第6张图片
    可以看出,GDI和DirectDraw是并行的关系,都可以访问驱动

    DirectX由以下各部分组成
    windows api 库 和 判断编译器类型_第7张图片

 

  • unity3d

可以配置使用opengl或directx来渲染图形

  • solidworks

最早是只支持opengl,现在支持opengl或directx


参考
http://www.myexception.cn/cpp/275831.html
http://www.fmddlmyy.cn/text5.html

你可能感兴趣的:(语言-语言对比,COM)