// windows_21_Library_Class_DLL_USE.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"//导入DLL文件#pragma comment(lib,"../bin/windows_21_Library_Class_DLL.lib")//需要声明一个类的定义,还需要导入类__declspec( dllimport )class __declspec( dllimport )CMath{public:int Add( int nAdd1, int nAdd2 );int Sub( int nSub1, int nSub2 );};int _tmain(int argc, _TCHAR* argv[]){//使用类CMath math;int nAdd = math.Add( 100, 100 );int nSub = math.Sub( 100, 100 );printf( "nAdd:%d\nnSub:%d\n", nAdd, nSub );return 0;}
21.2 windows_21_Library_Class_DLL_USE 动态库补充2
原文:http://www.cnblogs.com/nfking/p/5573266.html