DLL是组成windows系统的基石,在很多情况下的编程是离不开它的,今天说一下关于DLL编程的一些基础,也是必须要了解的。
主要分为两大类:(1)DLL的编写 (2)DLL的使用
1.DLL的编写
DLL编写需要一个头文件和一个源文件,头文件用于声明,源文件用于实现:
下面是我编写的一个例子程序的头文件中的内容:
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the TESTDLL_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// TESTDLL_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined w