How to return a vector or an array?
-
Hello all, I'm now wrting an IDL file for COM. if I want to return a vector of string, what can I do? The method that I want is following in c++ vector Function(); As far as I know, a string can be BSTR in IDL, so what in IDL corresponds to a vector or an array in C++? Thank you very much!
-
Hello all, I'm now wrting an IDL file for COM. if I want to return a vector of string, what can I do? The method that I want is following in c++ vector Function(); As far as I know, a string can be BSTR in IDL, so what in IDL corresponds to a vector or an array in C++? Thank you very much!
Try SAFEARRAY. But I think it is not recognized by MIDL compiler. Let me know if you find some other way of using arrays in IDL that MIDL recognizes.* * *
Have a great day ahead! Regards, Sohail Kadiwala (My Blog - http://blogs.wdevs.com/sohail/[^])
-
Try SAFEARRAY. But I think it is not recognized by MIDL compiler. Let me know if you find some other way of using arrays in IDL that MIDL recognizes.* * *
Have a great day ahead! Regards, Sohail Kadiwala (My Blog - http://blogs.wdevs.com/sohail/[^])
-
SAFEARRAY(BSTR) should be recognised and understood perfectly well by MIDL. I've worked on projects that made heavy use of these things, and stuff like SAFEARRAYs of user defined types Steve S Developer for hire
Hi Steve, the MIDL compiler doesn't understand SAFEARRAY (I read it in some article). Can you lead me to some good resource/URL where more on this is shown?* * *
Have a great day ahead! Regards, Sohail Kadiwala (My Blog - http://blogs.wdevs.com/sohail/[^])
-
SAFEARRAY(BSTR) should be recognised and understood perfectly well by MIDL. I've worked on projects that made heavy use of these things, and stuff like SAFEARRAYs of user defined types Steve S Developer for hire
Hi Steve, I am in very much need of Safearray related concepts and methodologies and its use in MIDL file.because I need much use of it too pass large values from COM Dll to VB in meterological projects and M/c related projects.Plz send me some codes and some URL where I can get get proper conceptual knowledge of SAFEARRAY with code.I'm currently facing difficulty in Passing SAFEARRAY from ATL/COM DLL to VB in an Event.So please help me.I am a memeber of this group by name Akshay Dave.My mail id is avd9683@rediffmail.com, akshayd@eqqu.com. Awaiting eagerly 4 ur reply. Akshay Dave Akshay Dave
-
Hi Steve, the MIDL compiler doesn't understand SAFEARRAY (I read it in some article). Can you lead me to some good resource/URL where more on this is shown?* * *
Have a great day ahead! Regards, Sohail Kadiwala (My Blog - http://blogs.wdevs.com/sohail/[^])
Good resource would be "Essential IDL" written by Martin Gudgin, or "Essential COM" by Don Box. If you write HRESULT getList([out]SAFEARRAY(BSTR)*ppsa); in your IDL for the interface method, in your C++ you have STDMETHOD(getList)(SAFEARRAY**ppsa); as a definition, and STDMETHODIMP class::getList(SAFEARRAY**ppsa) { ... } as your implementation. In IDL, the array type is known (and can be a simple type, like 'long' or 'DATE', or even a user defined type (structure)). One issue is that if you're using the MIDL that came with VC++6, you might want to upgrade by downloading the Platform SDK. In your implementation, you need to create a SAFEARRAY, and fill in the pointer properly. There must be loads of code out there, google for "SAFEARRAY IDL SOURCE" or look here[^] for some examples of more complicated stuff... Steve S Developer for hire
-
Hi Steve, I am in very much need of Safearray related concepts and methodologies and its use in MIDL file.because I need much use of it too pass large values from COM Dll to VB in meterological projects and M/c related projects.Plz send me some codes and some URL where I can get get proper conceptual knowledge of SAFEARRAY with code.I'm currently facing difficulty in Passing SAFEARRAY from ATL/COM DLL to VB in an Event.So please help me.I am a memeber of this group by name Akshay Dave.My mail id is avd9683@rediffmail.com, akshayd@eqqu.com. Awaiting eagerly 4 ur reply. Akshay Dave Akshay Dave
Hi Akshay, Did u check the link Steve has given? http://www.mvps.org/vcfaq/com/4.htm[^] Its got some good neat stuff on it. Also Check on MSDN for SAFEARRAY.* * *
Have a great day ahead! Regards, Sohail Kadiwala (My Blog - http://blogs.wdevs.com/sohail/[^])
-
Hi Steve, I am in very much need of Safearray related concepts and methodologies and its use in MIDL file.because I need much use of it too pass large values from COM Dll to VB in meterological projects and M/c related projects.Plz send me some codes and some URL where I can get get proper conceptual knowledge of SAFEARRAY with code.I'm currently facing difficulty in Passing SAFEARRAY from ATL/COM DLL to VB in an Event.So please help me.I am a memeber of this group by name Akshay Dave.My mail id is avd9683@rediffmail.com, akshayd@eqqu.com. Awaiting eagerly 4 ur reply. Akshay Dave Akshay Dave
You need to read either (or both) Essential IDL and Essential COM, or at a minimum, look for examples on MSDN and other sites (like this one) which use SAFEARRAYs. Google for SAFEARRAY SAMPLE or SAFEARRAY SOURCE which should help you get started. Alternatively, my rates for training (if you're UK based) are quite competitive :) Steve S Developer for hire