第3章操作系统及相关程序设计2内存管理.ppt

第3章操作系统及相关程序设计2内存管理

* * * * * * * 自己的过程函数2 int Factorial(int n) //计算n的阶乘 { int Fact=1; int i; for(i=1;i=n;i++) { Fact=Fact*i; } return Fact; } * *.def模块定义文件 LIBRARY dll_lib ;CODE PRELOAD MOVEABLE DISCARDABLE ;DATA PRELOAD MOVEABLE SINGLE EXPORTS ;The names of the DLL functions Summary ;函数名 Factorial ;函数名 * (3) Build菜单生成DLL (4)创建Win32 Console Application应用程序 (5)将(3)中生成的动态链接库*.DLL复制到新工程的debug文件夹中 * (6)编辑新工程cpp程序文件 #includeiostream.h #include stdafx.h //定义连接库中函数返回类型的指针,函数指针 typedef int (*SUMMARY)(int); * void main(void) { SUMMARY Sum; // HINSTANCE ghMathsDLL=NULL; //动态链接库句柄

文档评论(0)

1亿VIP精品文档

相关文档