Thank you for your quick reply. Hmmm... I tried changing the code to:
COMObject::GetArray(VARIANT* arr)
{
CComSafeArray<BSTR> * safeArray = new CComSafeArray<BSTR>(1); //parameter is size of array
safeArray.add("Hello");
CComVariant return(*safeArray);
ret.Detach(groups);
}...
Hi!
I'm trying to retun a safe array as a variant in a COM object. This is what I do:
COMObject::GetArray(VARIANT* arr)
{
CComSafeArray<BSTR> safeArray;
safeArray.add("Hello");
CComVariant return(safeArray);
ret.Detach(groups);
}
However, when I try to get the array from...
Hi!
In visual c++ I use a COM object that returns a VARIANT holding a SAFEARRAY.
Now I need to convert the VARIANT to a CComSafeArray in order to manipulate and extract the content in vc++.
How do I do this? (been working on the problem all morning and in desperate need of help)
Thanks /Dave
nevermind I solved it..
I had to put brackets around the parameter in VBS (like I did in the typo).
Well this has been a nice monologue, sorry for bothering you guys with it...
/Dave
Sorry in the VBScript, the fifth line is obviously:
collection2 = exchange1.exchangeNow collection1
So, does anyone know why I get the
Error:Expected end of statement
from VBS?
Hi!
I have created a COM object called Collection in VC++.
I have now created another COM object called let's say Exchange, which has the following IDL:
[id(1), helpstring("method exchange now")] HRESULT exchangeNow([in] IUnknown* coll1, [out, retval] IUnknown** coll2);
So...
I have two questions.
First of all, how does one declare private methods in a COM object created in VC++.
I have a list of STATIC FINAL STRING constants that I want the user of the COM object to be able to access. How do I do this?
Thanks /Dave
ERROR!
I thought everything was working fine, when I implemented the COM method using my COM Collection as described below:
STDMETHODIMP CAPIFactory::insertCollection(IUnknown* coll)
{
// TODO: Add your implementation code here
CComPtr<ICollection> pI...
Thanks for the quick replies guys...
Once I have received the Collection COM object to my new COM object (I guess it is actually the IDispatch interface I am receiving, right?)
How do I access the COM Collection object's functions in VC++? Do I simply cast it to an IDispatch* interface or...
Hi!
I have created a COM object in C++ called Collection.
I now want to pass this Collection as a parameter to another COM object. How do I specify that in the IDL and how do I access that the Collection objects parameters in the new object?
Thank you in advance /Dave
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.