473,322 Members | 1,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

IShellFolder.GetUIObjectsOf fails while accessing un unistatiated object

Hi all,
here I am again :-( , this turn I'm in trouble with
IShellFolder.GetUIObjectsOf, which raise an exception while accessing an
uninstantiated object (I have Italian version softwares and I litteraly
translate the error, the original error may sound a little different).

I'm using VB.Net, and I need to access ThumbImage extractor, I got
IShellFolder interface object pointing to the Directory where my file is in
(in following code it's named item), I know it' Ok since I can enumerate
contained objects through EnumObjects. Also Pidl is okay since
PathFromPidl(pidl) return a correct value. IntPtr.Zero, 1 and prgf should be
okay too :-).
So the problem seems to be IUnknown but shouldn't it be an output parameter?
Or It may be interface definition...

(by the way: how to instantiate a com object like IUnknown interface ?)

This is the code

Dim pidlPath As String = PathFromPidl(pidl)

' pidl is a relative pidl, so only the filename portion is relevant
If Path.GetFileName(pidlPath).Equals(Path.GetFileName (file)) Then
ret = True

Dim iUnk As IUnknown
' Try and get the IExtractImage interface:
Dim prgf As UInt32
Dim iidExtractImage As Guid = New
Guid("BB2E617C-0920-11d1-9A0B-00C04FC2D6C1")
item.GetUIObjectOf(IntPtr.Zero, 1, pidl, iidExtractImage, prgf,
iUnk)

'some code
End If

Here is the interface (just the method)

<PreserveSig()> _
Function GetUIObjectOf(ByVal hwndOwner As IntPtr,
<MarshalAs(UnmanagedType.U8)> ByVal cidl As Long, ByRef apidl As IntPtr,
ByVal riid As Guid, ByRef rgfReserved As UInt32, ByRef ppv As IUnknown) As
Int32

What's wrong?

Thanks, Nicola
Nov 20 '05 #1
1 1804
Nicola,
<PreserveSig()> _
Function GetUIObjectOf(ByVal hwndOwner As IntPtr,
<MarshalAs(UnmanagedType.U8)> ByVal cidl As Long, ByRef apidl As IntPtr,
ByVal riid As Guid, ByRef rgfReserved As UInt32, ByRef ppv As IUnknown) As
Int32

What's wrong?


cidl should be an Integer. riid should be passed ByRef.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Robin Tucker | last post by:
I've got this nice pidl, enumerated via. IEnumIDList on an IShellFolder (the desktop). I know the pidl is ok, because I can list its display name and its looking good. Now I want to go a level...
0
by: Nicola Garone | last post by:
Hi all, here I am again :-( , this turn I'm in trouble with IShellFolder.GetUIObjectsOf, which raise an exception while accessing an uninstantiated object (I have Italian version softwares and I...
1
by: Nicola Garone | last post by:
Hi all, here I am again :-( , this turn I'm in trouble with IShellFolder.GetUIObjectsOf, which raise an exception while accessing an uninstantiated object (I have Italian version softwares and I...
0
by: Nicola Garone | last post by:
Hi all, here I am again :-( , this turn I'm in trouble with IShellFolder.GetUIObjectsOf, which raise an exception while accessing an uninstantiated object (I have Italian version softwares and I...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.