简体   繁体   English

如何在我的C ++项目中包含activeX库?

[英]How do I include an activeX library in my C++ project?

I would like to add a third party library to my C++ project. 我想在我的C ++项目中添加一个第三方库。 The library is ActiveX and I have to admit, that I have no experience with that. 该库是ActiveX,我不得不承认,我对此没有经验。 I tried to google the solution but could not find one that fits for me. 我试图用Google搜索解决方案,但找不到适合我的解决方案。 I'm using Visual Studio and my project is not MFC. 我正在使用Visual Studio,而我的项目不是MFC。

From the third party library I have a dll-file, a tlb-file and an idl-file, but no header file. 从第三方库中,我有一个dll文件,一个tlb文件和一个idl文件,但是没有头文件。 I tried to include the tlb-file but when compiling I got a lot of errors from the kind of missing typedef for default-int and character is not allowed . 我试图包括tlb文件,但是在编译时,由于missing typedef for default-int而导致了很多错误,并且character is not allowed (just by writing #include "xyz.tlb" ) (只需编写#include "xyz.tlb"

Is the tlb file incompatible with my project? tlb文件与我的项目不兼容吗? Is there another way to include the activeX class I need? 有没有其他方法可以包含我需要的activeX类?

One could easily write an entire college course about doing what you're talking about. 可以轻松地写一整个大学课程来完成您所谈论的事情。 The simple answer is that you need to use #import not #include , but there is a lot more you'll have to deal with to properly utilize an activex library. 简单的答案是,你需要使用#import没有#include ,但有很多你必须处理合理利用的ActiveX库。

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

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