简体   繁体   English

从现有的 mfc 项目创建 dll

[英]Create dll from existing mfc project

I have a MFC project which contains many project inside.我有一个 MFC 项目,里面包含很多项目。 now i want to make a dll file of this project can anyone provide information how to create dll from existing mfc project ?现在我想为这个项目制作一个 dll 文件,谁能提供有关如何从现有 mfc 项目创建 dll 的信息?

EDIT编辑

I have tried following我试过以下

  • Project Properties > Configuration > General > Configuration Type, should be changed from Application (.exe) to Dynamic Library (.dll) Project Properties > Configuration > General > Configuration Type,应从 Application (.exe) 更改为 Dynamic Library (.dll)
  • Project Properties > Configuration > C\C++ > General > Preprocessor definitions, add _AFXDLL Project Properties > Configuration > C\C++ > General > Preprocessor definitions,添加 _AFXDLL

I have done this for the startup project does it contains all depending projects inside the dll?我已经为启动项目完成了此操作,它是否包含 dll 中的所有依赖项目?

Did you try:你试过了吗:
1. Right click on "Solution XXX" under Solution Explorer 1. 右击Solution Explorer下的“Solution XXX”
2. Click "New Project" 2.点击“新建项目”
3. dialog is popped out 3.弹出对话框
4. Choose Visual C++ ->MFC -> MFC DLL 4.选择Visual C++ ->MFC -> MFC DLL

It sounds like you want to take multiple projects which output a dll each, and compile them into one dll. If this is correct, then one way would be to add all classes in a solution to just one project.听起来您想采用多个项目,每个项目 output 一个 dll,并将它们编译成一个 dll。如果这是正确的,那么一种方法是将解决方案中的所有类添加到一个项目中。 Although i can't see this being a helpful development decision.尽管我看不出这是一个有用的开发决策。 Why do you want this?你为什么要这个?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM