Re: How to use ROT or IUnknown in VB? THE SOULTION
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.
HRESULT RegisterInROT([in] VARIANT varUnknown, [in] BSTR bstrID, [out, retval]
long * pCookie);
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
gnCookie = rot.RegisterInROT(ObjPtr(obj), szID)
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*.
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