问题标签 [idl]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
2322 浏览

c++ - 如何在给定自定义 IDL 的情况下编写代码生成器?

如果您有一个包含基本布尔字符串字段的足够简单的模式,那么如何在 C++ 中编写代码生成器。如果你曾经写过,你是如何开始的。欢迎文章/推荐。

编辑:请注意,这不是标准的 CORBA idl。

0 投票
6 回答
46389 浏览

idl - 什么是 IDL?

IDL 是什么意思?我google了一下,发现它代表接口定义语言,用于组件的接口定义。但是,在实践中,IDL 的目的是什么?微软使用它吗?

0 投票
1 回答
938 浏览

c++ - 在 win32 上编译 idl 文件时出现 midl 错误 2025(midl 不喜欢 string<40>)

我用 linux 工具编译的 idl 文件很好,但是当我尝试使用 midl 编译时出现错误

该行是:

这是非标准的idl,还是我错过了什么?midl 是否有允许此操作的开关?

我希望我能早点设置赏金...

0 投票
2 回答
1621 浏览

com - IDL 中不可创建的 coclass 的目的是什么?

在 IDL 中声明如下不可创建的 coclass 的原因是什么?

我的意思是这样的类无论如何都不会注册到 COM。在 IDL 文件和编译该 IDL 文件生成的类型库中提及它的原因是什么?

0 投票
2 回答
327 浏览

c++ - Why is it necessary to add new events to the *end* of an IDL interface?

I have found that when I add new events to an existing COM/IDL interface, I sometimes run into strange issues unless they are added to the end of the interface.

For example, say I have the following interface:

Now let's say I want to add a new callback event, NewCallback. If I add it like this, I tend not to have any problems when the event is fired across COM:

But if I add it like this, I can run into all sorts of problems (e.g. buffer overruns) when the event is fired.

I'm guessing it has something to do with DLL entry points, address offsets, or something similar. Or maybe it's because I haven't re-built something properly, and adding it to the end allows it to work by sheer luck.

Can anyone explain this behaviour?

0 投票
2 回答
1011 浏览

c++ - 有没有办法让 midl 在单独的 .h 中生成每个接口?

我有一堆继承从 idl 文件生成的抽象接口的对象。使用这些接口的每个对象都包含相同的文件 interfaces.h,其中包含所有 c++ 生成的映射到 idl 接口的抽象类。

每次我将任何内容更改为interfaces.idl 时,每个依赖于此的类都必须重建,因为interfaces.h 发生了变化。是否有一个标志或其他东西告诉 midl 在自己的 .h 中生成每个抽象类?

0 投票
2 回答
1324 浏览

com - 如何防止在 ATL 类型库中公开 coclass 实现

我正在构建一个具有类工厂类型的 ATL 类型库。有点像这样:

然后,用户可以INumber通过NumberFactory.

这很好用,但我不知道如何定义和实例化通过该NumberFactory.GetNumber()方法返回的 ATL 对象。如果我这样定义 IDL 中的数字:

Onecoclass 可以由用户实例化。但我想限制它,所以获得Onecoclass 实例的唯一方法是调用NumberFactory.GetNumber("One").

所以我的问题是:应该如何编写 IDL 以便用户无法实例化One,但仍然能够OneNumberFactorycoclass 内部实例化并将INumber接口返回One给用户?

此外,为了使其工作,在 ATL 方面是否必须做任何特别的事情?

0 投票
1 回答
133 浏览

c# - 如何用接口描述语言表达一个 int[] 属性?

你将如何在 IDL 中实现这个属性:

我尝试了下面的idl代码

但是我的编译器正在寻找这个

我 99.999% 确定这是类型的问题。

0 投票
1 回答
3354 浏览

c# - 如何通过idl中的c ++ com接口从c#传递bool

我知道我缺少一些简单的东西,我对这些 com 东西几乎没有经验。

我想在 idl 的接口中执行此操作

但是,这给出了: [out] 参数不是指针。

好的,我明白了。

但是,在实现此功能的 C# 代码中,我无法从 IsValid() 方法返回 bool*,因为它不安全。

我返回布尔值的正确方法是什么?

0 投票
1 回答
886 浏览

c++ - .idl 导入接口中的 coclass 在别处定义?

我有一个 IDL 文件,它定义了几个接口,后跟一个 coclass。我可以让这个类导入这个类中没有定义的接口吗?