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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COM Parameters

Status
Not open for further replies.

abramowi

Technical User
May 2, 2003
10
0
0
GB
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 basically what I want to do is pass one Collection into Exchange and get another Collection out.

So when I wanted to test it in VBScript I wrote the following:

----
Set collection1 = CreateObject("COMCollection.Collection")
set collection2 = CreateObject("COMCollection.Collection")
Set exchange1 = CreateObject("COMExchange.Exchange")

collection2 = exchange1.exchangeNow(collection1)
----

So when I tried this script I got the following error from the VB compiler:

Line: 5
Error: Expected end of statement


Anyone know why?
 
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?
 
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
 
Nice to let us know you solved it anyway.
Noting wrong with mologues....


Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top