简体   繁体   English

在x64系统上使用来自32位应用程序的IFilter

[英]Using IFilter from a 32bit app on a x64 system

I need to use an IFilter interface from a 32bit app on Windows x64 systems. 我需要在Windows x64系统上使用32位应用程序的IFilter接口。 This is easy for .doc files as offfilt.dll supports both build types. 这对.doc文件很容易,因为offfilt.dll支持两种构建类型。 However, I need to also get the plain text from .docx and other files types. 但是,我还需要从.docx和其他文件类型中获取纯文本。 The solution at first is to install Microsoft Filter Packs . 解决方案首先是安装Microsoft Filter Pack However, only the x64 version will install ... which means my 32bit app can't use them. 但是,只安装x64版本...这意味着我的32位应用程序无法使用它们。 They work great under 32bit Windows. 它们在32位Windows下运行良好。

Has anyone found a way around this? 有没有人找到解决这个问题的方法?

I found a way to install docx Filter Pack 32bits in a 64bits OS. 我找到了一种在64位操作系统中安装docx Filter Pack 32bits的方法。 To other file formats is similar. 其他文件格式类似。

  1. Install Filter Pack 32 bits in a 32bits OS; 在32位操作系统中安装32位过滤器包;
  2. Copy ifilters files in directory “C:\\Program Files\\Common Files\\Microsoft Shared\\Filters” from 32 bits OS to the a directory “C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\Filters” in 64bits OS. 将目录“C:\\ Program Files \\ Common Files \\ Microsoft Shared \\ Filters”中的ifilters文件从32位操作系统复制到64位操作系统中的目录“C:\\ Program Files(x86)\\ Common Files \\ Microsoft Shared \\ Filters”。
  3. Copy the following lines to a file “ifilter.reg” and execute the file: 将以下行复制到文件“ifilter.reg”并执行该文件:

File's content: 文件内容:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.docx\PersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"

[HKEY_CLASSES_ROOT\.docm\PersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"

[HKEY_CLASSES_ROOT\.dotx\PersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.docm\PersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.docx\PersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.dotx\PersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}]
@="Office Open XML Format Word Persistent Handler"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}\PersistentAddinsRegistered]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}\PersistentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{5A98B233-3C59-4B31-944C-0E560D85E6C3}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}]
@="Office Open XML Format Word Persistent Handler"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}\PersistentAddinsRegistered]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}\PersistentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{5A98B233-3C59-4B31-944C-0E560D85E6C3}"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{5A98B233-3C59-4B31-944C-0E560D85E6C3}\InprocServer32]
@="C:\\Program Files (x86)\\Common Files\\microsoft shared\\Filters\\offfiltx.dll"
"ThreadingModel"="Both"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{5A98B233-3C59-4B31-944C-0E560D85E6C3}\InprocServer32]
@="C:\\Program Files (x86)\\Common Files\\microsoft shared\\Filters\\offfiltx.dll"
"ThreadingModel"="Both"


[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}\PersistentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{5A98B233-3C59-4B31-944C-0E560D85E6C3}"

Extending Rui answer with windows registry script for 3 file formats (Word, Excel, PowerPoint). 使用Windows注册表脚本扩展Rui应答3种文件格式(Word,Excel,PowerPoint)。 Hope, will safe time for somebody as it worked well: 希望,对于某人工作得很好的安全时间:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.docx\PersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"
[HKEY_CLASSES_ROOT\.pptx\PersistentHandler]
@="{4F46F75F-199F-4C63-8B7D-86D48FE7970C}"
[HKEY_CLASSES_ROOT\.xlsx\PersistentHandler]
@="{4887767F-7ADC-4983-B576-88FB643D6F79}"


[HKEY_CLASSES_ROOT\.docm\PersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"
[HKEY_CLASSES_ROOT\.pptm\PersistentHandler]
@="{4F46F75F-199F-4C63-8B7D-86D48FE7970C}"
[HKEY_CLASSES_ROOT\.xlsm\PersistentHandler]
@="{4887767F-7ADC-4983-B576-88FB643D6F79}"

[HKEY_CLASSES_ROOT\.dotx\PersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.docm\PersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.docx\PersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.pptm\PersistentHandler]
@="{4F46F75F-199F-4C63-8B7D-86D48FE7970C}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.pptx\PersistentHandler]
@="{4F46F75F-199F-4C63-8B7D-86D48FE7970C}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xlsm\PersistentHandler]
@="{4887767F-7ADC-4983-B576-88FB643D6F79}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xlsx\PersistentHandler]
@="{4887767F-7ADC-4983-B576-88FB643D6F79}"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.dotx\PersistentHandler]
@="{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}]
@="Office Open XML Format Word Persistent Handler"
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{4F46F75F-199F-4C63-8B7D-86D48FE7970C}]
@="Office Open XML Format PowerPoint Persistent Handler"
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{4887767F-7ADC-4983-B576-88FB643D6F79}]
@="Office Open XML Format Excel Persistent Handler"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}\PersistentAddinsRegistered]
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{4F46F75F-199F-4C63-8B7D-86D48FE7970C}\PersistentAddinsRegistered]
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{4887767F-7ADC-4983-B576-88FB643D6F79}\PersistentAddinsRegistered]

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}\PersistentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{5A98B233-3C59-4B31-944C-0E560D85E6C3}"
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{4F46F75F-199F-4C63-8B7D-86D48FE7970C}\PersistentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{DDFE337F-4987-4EC8-BDE3-133FA63D5D85}"
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{4887767F-7ADC-4983-B576-88FB643D6F79}\PersistentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{F90DFE0C-CBDF-41FF-8598-EDD8F222A2C8}"


[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}]
@="Office Open XML Format Word Persistent Handler"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{4F46F75F-199F-4C63-8B7D-86D48FE7970C}]
@="Office Open XML Format PowerPoint Persistent Handler"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{4887767F-7ADC-4983-B576-88FB643D6F79}]
@="Office Open XML Format Excel Persistent Handler"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}\PersistentAddinsRegistered]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{4F46F75F-199F-4C63-8B7D-86D48FE7970C}\PersistentAddinsRegistered]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{4887767F-7ADC-4983-B576-88FB643D6F79}\PersistentAddinsRegistered]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}\PersistentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{5A98B233-3C59-4B31-944C-0E560D85E6C3}"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{4F46F75F-199F-4C63-8B7D-86D48FE7970C}\PersistentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{DDFE337F-4987-4EC8-BDE3-133FA63D5D85}"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{4887767F-7ADC-4983-B576-88FB643D6F79}\PersistentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{F90DFE0C-CBDF-41FF-8598-EDD8F222A2C8}"

[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{5A98B233-3C59-4B31-944C-0E560D85E6C3}\InprocServer32]
@="C:\\Program Files (x86)\\Common Files\\microsoft shared\\Filters\\offfiltx.dll"
"ThreadingModel"="Both"
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{DDFE337F-4987-4EC8-BDE3-133FA63D5D85}\InprocServer32]
@="C:\\Program Files (x86)\\Common Files\\microsoft shared\\Filters\\offfiltx.dll"
"ThreadingModel"="Both"
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{4887767F-7ADC-4983-B576-88FB643D6F79}\InprocServer32]
@="C:\\Program Files (x86)\\Common Files\\microsoft shared\\Filters\\offfiltx.dll"
"ThreadingModel"="Both"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{5A98B233-3C59-4B31-944C-0E560D85E6C3}\InprocServer32]
@="C:\\Program Files (x86)\\Common Files\\microsoft shared\\Filters\\offfiltx.dll"
"ThreadingModel"="Both"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{DDFE337F-4987-4EC8-BDE3-133FA63D5D85}\InprocServer32]
@="C:\\Program Files (x86)\\Common Files\\microsoft shared\\Filters\\offfiltx.dll"
"ThreadingModel"="Both"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{F90DFE0C-CBDF-41FF-8598-EDD8F222A2C8}\InprocServer32]
@="C:\\Program Files (x86)\\Common Files\\microsoft shared\\Filters\\offfiltx.dll"
"ThreadingModel"="Both"


[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{D3B41FA1-01E3-49AF-AA25-1D0D824275AE}\PersistentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{5A98B233-3C59-4B31-944C-0E560D85E6C3}"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{4F46F75F-199F-4C63-8B7D-86D48FE7970C}\PersistentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{DDFE337F-4987-4EC8-BDE3-133FA63D5D85}"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\CLSID\{4F46F75F-199F-4C63-8B7D-86D48FE7970C}\PersistentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}]
@="{F90DFE0C-CBDF-41FF-8598-EDD8F222A2C8}"

As you found out, there isn't a supported way to install the 32-bit filters on a 64-bit system, see reply from MSFT near the end of this post: How can I install the 32 bit Office Filter Pack on a 64 bit system? 如您所知,没有一种支持的方法在64位系统上安装32位过滤器,请参阅本文末尾附近的MSFT回复: 如何在64位上安装32位Office过滤器包位系统? .

The solution suggested there, is to create a helper program to do the filtering and pass the data back to the main application. 建议的解决方案是创建一个辅助程序来进行过滤并将数据传递回主应用程序。

There are a number of ways to do IPC in Windows, so pick the one that works for you. 在Windows中有很多方法可以做IPC,所以选择一个适合你的方法。 I've created a service that uses WCF to easily create a remote proxy that makes the operation very transparent to the main application. 我创建了一个使用WCF轻松创建远程代理的服务,该操作使操作对主应用程序非常透明。

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

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