|
-
Jul 31st, 2001, 07:26 PM
#1
Thread Starter
New Member
COM: IUnknown as method parameter
Can VB accept an IUnknown parameter when called from a VC++ client using a method?
-
Aug 1st, 2001, 08:37 PM
#2
Hyperactive Member
IUnknown
Hi there,
I think you can pass an IUnknown Parameter into VB. Emphasis on the word..."think" 
The reason for this is that the collection class in VB has a _NewEnum Function that is of an IUnknown type. When I create a Collection component DLL and I wrap the functions and methods on an intrinsic Collection class in my component, I need to write a _NewEnum as an IUnknown Function. This function has a hidden property and cant be seen from the client and this is meant for use for client needing to call the collection class thru the use of For Each Ship in Ships...Next.
If this IUnknown function is not included, you cant use the For Each...Next Loop. Instead you have to use the For i = 0 to Ships.Count...Next Loop which, I think, is less elegant.
Therefore, I think you can pass an IUnknown Parameter into VB.
Function _NewEnum() As Unknown
William T
Software Architect / Chief Software Developer
Softwaremaker.Net Pte Ltd
http://www.Softwaremaker.net
*** Things are always the darkest before they go pitch black ***
-
Aug 2nd, 2001, 11:09 AM
#3
Thread Starter
New Member
After hacking away at the problem, we found that we could passed the IUnknown on the client side as a VARIANT. The VB server was then able to get the IUnknown.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|