Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VC10.0
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'
Posted 12-Feb-11 2:34am
Edited 12-Feb-11 2:46am
TweakBird17.1K
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
Comments
SAKryukov at 12-Feb-11 22:13pm
   
More advanced answer, 5
--SA
Nishant Sivakumar at 12-Feb-11 22:25pm
   
Thanks SA.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  
v3
Comments
SAKryukov at 12-Feb-11 22:12pm
   
Clear answer, my 5, but Nishant's answer give further idea.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 George Jonsson 215
1 Kornfeld Eliyahu Peter 169
2 OriginalGriff 120
3 PIEBALDconsult 110
4 BillWoodruff 85
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,294


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 12 Feb 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100