MFC DLL的创建

 

MFC DLL的创建

 

关键点

 

 

实现过程

 
 
1.创建1个 MFC AppWizard(dll),Project name:project01
2.选中 Regular DLL using shared MFC DLL.单击Finished完成。
3.在project01.cpp中加入自定义的函数,代码如下
 
1
2

 

 

// project01.cpp : Defines the initialization routines for the DLL.  

CProject01App theApp;
int add(int x,int y)
{
    return x+y;
}
 
int sub(int x,int y)
{
    return x-y;

}

函数导出

; project01.def : Declares the module parameters for the DLL.
 
LIBRARY      "project01"
DESCRIPTION  'project01 Windows Dynamic Link Library'
 
EXPORTS
    ; Explicit exports can go here
    sub
    add

 

   


 

备注

只导出函数名字,而不包括参数

 

相关链接

MFC DLL的调用                           

 

 




附件列表

    原文地址:https://www.cnblogs.com/xe2011/p/2923674.html