在VS 2008中构建代理/存根dll [英] Building Proxy/Stub dll in VS 2008

查看:93
本文介绍了在VS 2008中构建代理/存根dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从VC6迁移到VS2008的ATLCOM项目.我的问题是,如何在VS 2008上构建ps dll?

I have a ATLCOM project migrated from VC6 to VS2008. My question is, how do I build the ps dllon VS 2008?

VS2008中的新ATL项目有一个单独的PS项目,该项目构建ps dll.但是从VC6迁移并没有创建此项目.

New ATL projects in VS2008 have a separate PS project which builds the ps dll. But the migration from VC6 did not create this project.

我试图在ps mk文件上调用nmake,但是这为源文件和自动包含的Windows头文件中都存在的枚举类型给出了重新定义错误.在解决方案中,我们通过定义WIN32_LEAN_AND_MEAN预处理程序来解决此问题,该预处理程序排除了不必要的头文件.我可以在使用nmake时做同样的事情吗?

I tried to invoke nmake on the ps mk file but that gives a redefinition error for an enum type which exists in both our source file as well as an automatically included windows header file. In the solution we fixed this by defining the WIN32_LEAN_AND_MEAN preprocessor which excludes unnecessary header files. Can I do the same while using nmake?

还有其他创建ps dll的方法吗?

Is there any other way of creating the ps dll?

推荐答案

Eran的建议似乎合乎逻辑,但我找不到他在谈论的一些内容.所以我尝试了另一种方法.

Eran's suggestions seem logical but I was not able to find some of the items he was talking about. So I tried a different approach.

我在VS 2008中创建了一个空的ATL(服务器)项目.这会自动创建一个与常规atl项目一起的ps项目.

I created an Empty ATL (Server) project in VS 2008. This automatically creates a ps project along with the normal atl project.

我将ps项目的vcproj文件复制到了我的项目文件夹中,并将其重命名为 myprojectname ps.vcproj.

I copied the vcproj file for the ps project into my project folder and renamed it to myprojectnameps.vcproj.

然后,我打开我的解决方案并将新复制的项目添加到其中.我将项目(在VS 2008中)重命名为 myprojectname ps,并删除了其中已包含的所有文件.

Then I opened my solution and added the newly copied project to it. I renamed the project (in VS 2008) to myprojectnameps and removed all the files that were already included in it.

接下来,我将 _i.c,_p.c,dlldata.c .def 文件包含到项目中.在链接器>输入>模块定义文件下的设置中,我添加了def文件名.

Next I included my _i.c, _p.c, dlldata.c and the .def file into the project. In the settings under Linker > Input > Module definition file, I added my def file name.

就是这样!像魅力一样工作.

That's it! Worked like a charm.

这篇关于在VS 2008中构建代理/存根dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆