Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. abramowi

    return a safearray as a variant from a COM objects

    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(&quot;Hello&quot;); CComVariant return(*safeArray); ret.Detach(groups); }...
  2. abramowi

    return a safearray as a variant from a COM objects

    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(&quot;Hello&quot;); CComVariant return(safeArray); ret.Detach(groups); } However, when I try to get the array from...
  3. abramowi

    Convert a Variant to CComSafeArray

    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
  4. abramowi

    COM Parameters

    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
  5. abramowi

    COM Parameters

    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?
  6. abramowi

    COM Parameters

    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(&quot;method exchange now&quot;)] HRESULT exchangeNow([in] IUnknown* coll1, [out, retval] IUnknown** coll2); So...
  7. abramowi

    private methods in COM objects and public variables in COM objects

    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
  8. abramowi

    How is a COM object passed as a parameter to another COM Object?

    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...
  9. abramowi

    How is a COM object passed as a parameter to another COM Object?

    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...
  10. abramowi

    How is a COM object passed as a parameter to another COM Object?

    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

Part and Inventory Search

Back
Top