用于C ++项目的tlb COM文件生成 [英] tlb COM file generation for C++ project

查看:84
本文介绍了用于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教程 [
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文件生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆