Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1473

A "Wraparound" IUnknown so the 3 members got visible.

$
0
0
Since IUnknown Interface (which is the stemfather of most of all the Interfaces in the Shell32 Interfaces I see it abit awkward why just this interface shall be "hidden" within the OleExp TypeLib (It was never hidden within the EnumDeskVB TypeLib from 1998).
Here is a little walkaround to make these 3 members availabale/Visible.

Code:

Public Function GetIUnknown() As oleexp.IUnknown
  Dim pISF As IShellFolder
  Dim ppISF As Long
  Dim pIUnk As oleexp.IUnknown
 
  SHGetDesktopFolder ppISF
 
  MoveMemory pISF, ppISF, 4
 
  Set pIUnk = pISF
 
  Set GetIUnknown = pIUnk
 
End Function

You can also add a pidl, path or an object to Create a IShellItem and get the IUnknown from there.

Viewing all articles
Browse latest Browse all 1473


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>