windows api 庫 和 判斷編譯器類型

  • 編譯器特徵



一般情況下,有如下編譯器特徵:
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



版本對應關係
msvcr80-vc2005
msvcr90-vc2008
msvcr100-vc2010
msvcr110-vc2012
msvcr120-vc2015

  • Visual studio 設置如何鏈接C運行庫和C++運行庫 

如果設置成了動態鏈接,則打包時需要把運行庫msvcr100.dll和msvcp100.dll都打包,以防止部署到某個計算機上,而那臺計算機缺少對應的運行庫,而運行不了
如果設置成了靜態鏈接,則不存在這個問題

  • Visual studio 設置如何鏈接MFC 
    如果設置成了動態鏈接,則打包時需要把運行庫mfc100.dll都打包,以防止部署到某個計算機上,而那臺計算機缺少對應的運行庫,而運行不了
    如果設置成了靜態鏈接,則不存在這個問題



 

  • windows操作系統的調用層次



①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


    可以看出,GDI和DirectDraw是並行的關係,都可以訪問驅動

    DirectX由以下各部分組成

 

  • unity3d

可以配置使用opengl或directx來渲染圖形

  • solidworks

最早是隻支持opengl,現在支持opengl或directx


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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章