[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pnet-developers] Re: RE : RE : RE : RE : RE : RE : RE : [Pnet-developer
From: |
Rhys Weatherley |
Subject: |
[Pnet-developers] Re: RE : RE : RE : RE : RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder |
Date: |
Fri, 25 Jul 2003 08:53:30 +1000 |
User-agent: |
KMail/1.4.3 |
On Thursday 24 July 2003 11:33 pm, Yannis BRES wrote:
> [DllImport("shell32.dll",CallingConvention=CallingConvention.Winapi)]
> [MethodImpl(MethodImplOptions.PreserveSig)]
> extern private static Int32 SHGetFolderPath
> (IntPtr hwndOwner, int nFolder, IntPtr hToken,
> uint dwFlags, [MarshalAsAttribute(UnmanagedType.LPTStr)] string path);
You will probably need to allocate a buffer using "Marshal.AllocHGlobal" and
pass it as the "path" parameter. Then use "PtrToStringAnsi" to convert it
into a C# string. Also, name the function "SHGetFolderPathA" to explicitly
pick up the ANSI version.
MS'es engine does a lot of things "by magic" that we don't currently support,
although we will eventually. At the moment, you have to be a little more
explicit when calling Win32 functions via PInvoke. e.g.
[DllImport("shell32.dll",CallingConvention=CallingConvention.Winapi)]
extern private static Int32 SHGetFolderPathA
(IntPtr hwndOwner, int nFolder, IntPtr hToken, uint dwFlags, IntPtr path);
Cheers,
Rhys.
- RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder, (continued)
- RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder, Yannis BRES, 2003/07/23
- Re: RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder, Gopal V, 2003/07/23
- Re: RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder, Rhys Weatherley, 2003/07/23
- RE : RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder, Yannis BRES, 2003/07/24
- Re: RE : RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder, Rhys Weatherley, 2003/07/24
- RE : RE : RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder, Yannis BRES, 2003/07/24
- Re: RE : RE : RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder, Rhys Weatherley, 2003/07/24
- RE : RE : RE : RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder, Yannis BRES, 2003/07/24
- [Pnet-developers] Re: RE : RE : RE : RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder, Rhys Weatherley, 2003/07/24
- RE : RE : RE : RE : RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder, Yannis BRES, 2003/07/24
- [Pnet-developers] Re: RE : RE : RE : RE : RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder,
Rhys Weatherley <=
- RE : RE : RE : RE : RE : RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder, Yannis BRES, 2003/07/25
Re: [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder, Gopal V, 2003/07/24