dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE : RE : RE : RE : RE : RE : RE : [Pnet-developers] System.NotImplement


From: Yannis BRES
Subject: RE : RE : RE : RE : RE : RE : RE : [Pnet-developers] System.NotImplementedException when implementing Environment.GetSpecialFolder
Date: Thu, 24 Jul 2003 15:33:44 +0200

     Great.  When implementing everything at the C# level, the code is only
a few line...
     However, I can't manage to PInvoke SHGetFolderPath
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/pl
atform/shell/reference/functions/shgetfolderpath.asp) successfully.  I've
tried to translate the signature, then I found 2 propositions on the web,
but in all cases I only get that:  SHGetFolderPath: could not resolve
symbolUncaught exception: System.MissingMethodException: Attempted to access
a non-existing method.
     Here are my attempts, any idea ?

// From my not so good/common sense:
[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);

// From http://www.dotnet247.com/247reference/msgs/2/11935.aspx
[DllImport("SHFolder", CharSet = CharSet.Unicode)]
public static extern int SHGetFolderPath
  (int hwndOwner, int nFolder, int hToken, int dwFlags,
  [MarshalAsAttribute(UnmanagedType.LPTStr)] string pszPath);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]