如何使用正确的非托管根据DLL文件CPU构建筑? (六十四分之三十二位) [英] How to use the correct unmanaged DLL file according CPU architecure? (32 / 64 bits)

查看:107
本文介绍了如何使用正确的非托管根据DLL文件CPU构建筑? (六十四分之三十二位)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用C ++的DLL文件从一个ASP.NET网站。该网站将被托管在32位和64位环境。

I have to use a C++ DLL file from an ASP.NET site. The site will be hosted on both 32 and 64 bits environments.

我有一个32位和64位版本的非托管的DLL文件。如何导入的方法从正确的按当前的服务器架构?

I have a 32 and 64 bits version of the unmanaged DLL file. How do I import the methods from the correct one according the current server architecture?

好像有人贴了,这可以作为部署问题进行处理。我关心的是:Web应用程序消耗这个DLL文件是巨大的,我们没有部署文档。没有人会记得部署正确的DLL文件,所以我想从溶液中除去人为因素:)

Like someone posted, this could be handled as a deployment problem. My concern is: the web application consuming this DLL file is huge, and we don't have a deployment document. No one will remember to deploy the correct DLL file, so I'm trying to remove the human factor from the solution :)

推荐答案

最简单的方法是给两个机库相同的文件名中的两个不同的目录,然后的adjust您的应用程序的DLL搜索路径根据位数。

Simplest approach would be to give the two native libraries the same filename in two different directories, then adjust your application DLL search path depending on the bitness.

<一个href="http://www.pinvoke.net/default.aspx/kernel32.setdlldirectory">http://www.pinvoke.net/default.aspx/kernel32.setdlldirectory

这篇关于如何使用正确的非托管根据DLL文件CPU构建筑? (六十四分之三十二位)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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