[英]How to use #import on oleaut32.dll from windows32 for 64bit project
I have this big visual studio solution that is currently on 32 bits (x86) for an application that uses Standard Windows Libraries,uses Multi-Byte Character Set and has No Common Language Runtime Support.I was tasked to compile it on 64 bits(stuff for work).I want to import oleaut32.dll
library because it is on 64 bits. 我有一个大型Visual Studio解决方案,当前针对使用标准Windows库,使用多字节字符集且不提供公共语言运行时支持的应用程序为32位(x86)。我受命在64位上编译它(东西我想导入
oleaut32.dll
库,因为它在64位上。
When i started to change the platform of the project and compile it,I got some compilation errors(32 bit functions ,linking problems) ,most of them are solved now.The issue is that it imported olepro32.dll (which worked on 32bits),it says it is an old format or invalid type library (because it is a 32 bit library). 当我开始更改项目的平台并进行编译时,我遇到了一些编译错误(32位函数,链接问题),现在大多数问题都已解决。问题是它导入了olepro32.dll(可在32位上运行) ,它表示它是旧格式或无效的类型库(因为它是32位的库)。
I searched the internet for it's 64 bits version and found out it is oleaut32.dll.I tried to import it ,but it won't let me i get error C1083: c:\\windows\\system32\\oleaut32.dll': Error loading type library/DLL
. 我在互联网上搜索了它的64位版本,发现它是oleaut32.dll。我尝试导入它,但它不会让我出现错误C1083:
c:\\windows\\system32\\oleaut32.dll': Error loading type library/DLL
。
I tried to change the project properties(Changed from: No Common Language Runtime Support
to Common Language Runtime Support
,it didn't work ). 我试图更改项目属性(从“
No Common Language Runtime Support
更改为 Common Language Runtime Support
,它不起作用”)。
I looked on microsoft website for the causes of error C1083 ,where I suspected the issues were: 我在Microsoft网站上查找了错误C1083的原因,我怀疑其中的原因是:
I tried running visual studio with administrator privilages ,it didn't work. 我尝试以管理员权限运行Visual Studio,但没有用。
I found out it is a COM library,I don't know what's the deal with it. 我发现这是一个COM库,我不知道该怎么处理。
On x86 platform the code was : 在x86平台上,代码为 :
#import <olepro32.dll> rename("FONTSIZE", "FONTSIZE_OLE32") no_auto_exclude include("IFont", "IPicture")
On x64 platform I tried to replace the code above with: 在x64平台上,我尝试将上面的代码替换为:
#import <oleaut32.dll> rename("FONTSIZE", "FONTSIZE_OLE32") no_auto_exclude include("IFont", "IPicture")
I was expecting that this would run smoothly since oleaut32.dll is a 64 bit library situated in windows32 folder.But I get Error loadin DLL
我期望这会顺利运行,因为oleaut32.dll是位于Windows32文件夹中的64位库。但是我在
Error loadin DLL
加载Error loadin DLL
oleaut32.dll has no relation with olepro32.dll and is not a Typelib oleaut32.dll与olepro32.dll没有关系,并且不是Typelib
olepro32.dll is a TypeLib and exposes IPicture and IFont interfaces olepro32.dll是TypeLib,它公开IPicture和IFont接口
You include those interfaces with : 您可以通过以下方式包含这些接口:
#include <ocidl.h>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.