Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / November 2004

Tip: Looking for answers? Try searching our database.

SHGetFolderLocation - freeing pointers

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff Gaines - 15 Nov 2004 12:59 GMT
I am using SHGetFolderLocation to get an IntPtr to the Desktop folder,
I have declared it as follows:

//    SHGetFolderLocation
[DllImport("shell32.dll", EntryPoint="SHGetFolderLocation",
SetLastError=true, CallingConvention=CallingConvention.StdCall)]
public static extern int SHGetFolderLocation(IntPtr hwndOwner, int
nFolder, IntPtr hToken, int dwReserved, ref IntPtr ppidl);

The help file says:
       
The calling application is responsible for freeing this pointer with
the Shell's IMalloc interface (see SHGetMalloc).

Do I need to free the pointer returned in ppidl?
I don't use SHMalloc, in fact I'm sure I read in the help that it
shouldn't be used any more (?just in .NET) and to use Marshal instead.

Signature

Jeff Gaines Damerham Hampshire UK
Posted with XanaNews 1.16.4.6

Jeff Gaines - 15 Nov 2004 13:44 GMT
> I am using SHGetFolderLocation to get an IntPtr to the Desktop folder,
> I have declared it as follows:

[snipped]

Sorry, this was meant for interop, I have re-posted it there.

Signature

Jeff Gaines Damerham Hampshire UK
Posted with XanaNews 1.16.4.6


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.