-
Re: How to use ROT or IUnknown in VB? THE SOULTION
Hello,
I have a solution from one of my workmate.
I could pass the IUnknown* of the object to a C++ function where I could
register the object in ROT.
C++ function:
HRESULT RegisterInROT([in] VARIANT varUnknown, [in] BSTR bstrID, [out, retval]
long * pCookie);
VB client:
Dim szID As String
Dim rot As ROTHandlerInCpp
Dim obj As IUnknown
Dim gnCookie As Long
szID = "ID_IN_ROT"
Set rot = New ROTHandlerInCpp
Set obj = Form1.TableTree1
'MsgBox ObjPtr(obj)
gnCookie = rot.RegisterInROT(ObjPtr(obj), szID)
.........
rot.RevokeFromROT (gnCookie)
The key is : ObjPtr(obj), which is address of the tree object.
The pointer is passed as an integer instead of an IUnknown* in the variant.
It's not so beautiful, but works if I cast it back to IUnknown*.
HUH!!! :-)))
Istvan
Budapest, Hungary
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks