473,511 Members | 14,799 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Something wrong with my Piddle? (IShellFolder madness!)

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 down using this piddle and the
BindToObject method on the IShellFolder interface. Here's what I'm doing:

This is how I declare the method on my IShellFolder interface.

<PreserveSig()> _
Function BindToObject(ByVal pidl As IntPtr, ByVal pbc As IntPtr, ByVal riid
As Guid, ByRef ppv As IntPtr) As Int32

This is how I execute the method with my piddle (theFolder is an
IShellFolder, previously verified as being ok - I'm using it to enumerate
its children as pidls):

Dim ptrRet As IntPtr
theFolder.BindToObject(pIDL, IntPtr.Zero,
ShellLib.ShellGUIDs.IID_IShellFolder, ptrRet)

I know my piddle is ok, because I used it to get the display name for the
object it refers to. But I can't get an IShellFolder from this piddle. I
get an null reference exception when I try to execute the above method.
Nov 20 '05 #1
2 1050
Robin,
<PreserveSig()> _
Function BindToObject(ByVal pidl As IntPtr, ByVal pbc As IntPtr, ByVal riid
As Guid, ByRef ppv As IntPtr) As Int32


riid should be passed ByRef or marked with
<MarshalAs(UnmanagedType.LPStruct)>


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
Thank God for VPs!

(it now works)

Shame I now have a bald pate :)

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:OS**************@TK2MSFTNGP10.phx.gbl...
Robin,
<PreserveSig()> _
Function BindToObject(ByVal pidl As IntPtr, ByVal pbc As IntPtr, ByVal riidAs Guid, ByRef ppv As IntPtr) As Int32


riid should be passed ByRef or marked with
<MarshalAs(UnmanagedType.LPStruct)>


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 #3

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

Similar topics

5
2327
by: uberderf | last post by:
I have the following web page setup: http://angels.uberderf.com/glossary.html I have a 2 column table layout which is a glossary of terms and their meanings. When you view this page in firefox...
3
1358
by: Charles May | last post by:
I have a listview which checkboxes containing items to invoice. The Create Invoice button (button1) is disabled unless there are items checked. However, I had to use an if..then..else statement to...
4
2216
by: Robert | last post by:
something wrong in wx I wrote program training na Artificial Neural Network. It work well in console mode, but when I try to add GUI there is an error: FANN Error 10: Error reading info from...
3
2766
by: Cor | last post by:
Hi all, I think I do something wrong, but I don't see what. I have made a sample. The sample needs only a form with a combobox and this code. (I can tell you that it took a long time to see...
1
1415
by: Holly | last post by:
One of my clients called me this morning, having trouble with their blog loading. The blog does actually load, but only after such an unusually long wait it would have surely driven everyone else...
9
1724
by: Randy | last post by:
Hi all, I've been working on a simple two column layout for a site, but according to browsershots.org, my desing is not showing up correctly in Win/IE 5.01, 5.5 & 6 ! Please see details here:...
1
2212
by: alvarojaviervera | last post by:
Allways I think Firefox was strong, enough ... and so far THE BEST Web- browser (That what I Think) but, now Im fighting with it, may be Im doing something wrong (of course that is what happend to...
10
2475
by: Guillermo_Lopez | last post by:
Hello All, I am using VBA in access to perform some calculations. There is a particular sumation that is wrong (barely). this code is withing a loop. TDist = TDist + TempDist Both TDist...
0
1107
by: Pat | last post by:
Hi Guys, Please help me. I am having a strange issue. Not sure if I am doing something wrong or this is a bug. This is a sample code. This contains 2 text boxes(txtName, txtPhone) and 2 buttons...
0
7252
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7432
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5676
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.