简体   繁体   English

如何从64位窗口下运行的32位应用程序访问64位DLL?

[英]How do I access a 64 bit DLL from a 32 bit application running under 64 bit windows?

The OS is Windows XP 64 bits. 操作系统是Windows XP 64位。

The application is Microsoft Office 32 bits, on top of which my application (an office addin) runs. 该应用程序是Microsoft Office 32位,我的应用程序(办公室插件)运行在其上。

The DLL is a 64 bit Adobe Acrobat "IFilter" dll, which enables access to the contents of a .pdf file. DLL是64位Adobe Acrobat“IFilter”dll,可以访问.pdf文件的内容。

I thought that the solution to the problem is finding the 32 bit version of the IFilter dll, but because the OS is windows XP 64 bits the only version that will register properly is the 64 bits version. 我认为问题的解决方案是找到32位版本的IFilter dll,但由于操作系统是Windows XP 64位,唯一能够正确注册的版本是64位版本。

Setting the target platform of my .NET project to x86, 64 bit or "Any CPU" won't solve the problem. 将我的.NET项目的目标平台设置为x86,64位或“任何CPU”都无法解决问题。

The 64 bit IFilter works properly only when I invoke it from within a console application, but once it gets invoked from within the context of the office Add-In, it does nothing. 只有当我从控制台应用程序中调用它时,64位IFilter才能正常工作,但是一旦从办公室外接程序的上下文中调用它,它就什么也不做。

What's the best way to solve this problem? 解决这个问题的最佳方法是什么? Should I load the 64 bit dll into a new process and have the office add-in communicate with it using remoting? 我应该将64位dll加载到新进程中并让办公室加载项使用远程处理与它进行通信吗?

Also, for those of you familiar with IFilter, is it possible to deploy the 32 bit version of the IFilter along with the office add-in and then access it directly without searching the registry for the properly installed IFilter? 另外,对于那些熟悉IFilter的人,是否可以将32位版本的IFilter与office插件一起部署,然后直接访问它而无需在注册表中搜索正确安装的IFilter? ( I couldn't do it ) (我不能这样做)

You will need to Thunk to the DLL. 你将需要Thunk到DLL。 Whether this is possible in the WOW64 I'm not sure. 是否可以在WOW64中使用我不确定。 Certainly it was available on WOW32 in the eary days of NT. 当然,它在新界的日子里可以在WOW32上找到。

the theory was simply to cause an interupt in the program code - that would thunk over to the 32 bit address space where the DLL was loaded. 理论只是在程序代码中产生中断 - 这会导致加载DLL的32位地址空间。

It sounds like an interesting project. 这听起来像一个有趣的项目。

However for a quicker solution I would use what you say - host the dll in a 64bit process and communicate using what ever IPC you like (personally WCF Named pipes is quite easy, or perhaps you can use memory mapped files if the data tx is high volume. 然而,为了更快的解决方案,我会使用你所说的 - 在64位进程中托管dll并使用你喜欢的IPC进行通信(个人WCF命名管道非常简单,或者如果数据tx很高,你可以使用内存映射文件体积。

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

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