Here we're calling GetValue(), passing "in" (only) the index, passing "in" two char pointers and receiving those same two char pointer variables "out". COM requires you to create and pass "in" the addresses of those two string pointer variables, so it can fill those variables and pass them back "out". That's why they are defined as [in, out] variables.
So, when you first set up the variables, make sure to define them as [in, out] if you want to return one or more character strings from a COM object.
Does this help you understand?
BTW:
This example assumes that the project is a C++ client calling a C++ COM object. Otherwise, you'll likely have to use BSTR and/or SAFEARRAY variables to communicate between VB and C++.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.