用于C ++项目的tlb COM文件生成

编程入门 行业动态 更新时间:2024-10-18 01:29:34
本文介绍了用于C ++项目的tlb COM文件生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个简单的C ++项目.它具有1个COM接口和2个非常简单的功能.一切都可以正常编译,但是没有生成TLB文件?我需要在Visual Studio中进行设置吗?我尝试设置/TLBOUT链接器标志,但这没有任何作用. 我尝试设置用于注册dll的选项,但出现错误,提示注册失败. 有任何想法吗 ?

I have a simple C++ project. It has 1 COM interface with 2 very simple function. Everything compiles fine, but a TLB file is not being generated?? Is there any setting I need to set in Visual Studio? I tried setting the /TLBOUT linker flag but that doesn''t do anything. I tried setting the option for registering the dll, but I get an error that registration failed. Any ideas ?

class CTestObj : public ITest { public: void __stdcall Method1 (CString input) {cout<<"Input String: "<<input<<endl;} void __stdcall Method2 (int data){cout<<"Input Number: "<<data<<endl;} }; class __declspec(uuid("{206C2246-1047-42a2-96EE-0F9FBE776823}")) CTestObj;

依赖行者在结果DLL中未显示任何功能.我应该使用dll导出吗?类似于以下内容:

Dependency walker is not showing any functions in the resulting DLL. Should I use dll export? Something along the lines of:

Dependency Walker is showing no functions. Do I have to use dll export ?? Should I do something like this ? <pre lang="c++">__declspec(dllexport) STDMETHOD(Method1) (CString input) = 0;</pre>

推荐答案

似乎您缺少一些东西.看一下本教程: 分步COM教程 [ ^ ] 最好的问候 Espen Harlinn Seems you are missing a few things. Take a look at this tutorial: Step by Step COM Tutorial[^] Best regards Espen Harlinn

更多推荐

用于C ++项目的tlb COM文件生成

本文发布于:2023-11-15 22:33:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1598545.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   项目   tlb

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!