在interface(.idl)文件中使用STL类型 [英] using STL types in interface(.idl) file

查看:126
本文介绍了在interface(.idl)文件中使用STL类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在.idl文件中使用STL类型?例如如果我尝试使用stringstream作为方法的输入参数的类型,则会收到错误MIDL2025 : syntax error expecting a type specification near ''stringstream''

How to use STL types inside .idl file? e.g. If i try to use stringstream as type of input parameter of method, I get error MIDL2025 : syntax error expecting a type specification near ''stringstream''

推荐答案

,您不会将其放在IDL文件中.看一下这个MSDN示例,该示例演示如何将STL类型与ATL一起使用:

http://msdn.microsoft.com/en-us/library/3stwxh95 (v = VS.100).aspx [
You don''t put that in the IDL file. Take a look at this MSDN example that shows how to use STL types with ATL:

http://msdn.microsoft.com/en-us/library/3stwxh95(v=VS.100).aspx[^]


总之,你不能.您可以使用STL等来实现COM公开的方法,但是这些方法本身只能接受某些类型的参数.请参见此处 [
In short, you can''t. You can use STL and such to implement COM exposed methods but the methods themselves can only accept certain types as parameters. See here[^] for a list and details. COM is language neutral so it wouldn''t make sense to export C++ specific types.


这篇关于在interface(.idl)文件中使用STL类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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