Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than shlwapi, prefix the name with the module name and a period.
Declare Unicode Function PathCombine Lib "shlwapi.dll" Alias "PathCombineW" (<MarshalAs(UnmanagedType.LPTStr)> PathOut As System.Text.StringBuilder, <MarshalAs(UnmanagedType.LPTStr)> PathIn As String, <MarshalAs(UnmanagedType.LPTStr)> More As String) As IntPtr
VB Signature:
Declare Function PathCombine Lib "shlwapi.dll" Alias "PathCombineA" (ByVal szDest As String, ByVal lpszDir As String, ByVal lpszFile As String) As Long
Declare Function PathCombine Lib "shlwapi.dll" (TODO) As TODO
Notes:
This is similar, but not identical, to PathAppend and Path.Combine. For example, combining "C:\foo" with "\bar" yields "C:\bar" rather than "C:\foo\bar" or "\bar" respectively.
Current signature is incorrect, because return value is string and CLR trying to release the same string twice (return value and lpszDest). I have unxpected crashes. I think that type of return value should change to IntPtr. This page contains some discussion about this problem: http://objectmix.com/dotnet/747522-p-invoke-signature-pathcombine.html
//nunit test case
[Test]
public void TestGetAbsolutePath()
{
Assert.AreEqual(@"c:\abc\123.txt",IO.GetAbsolutePath(@"c:\abc\","123.txt"),"Test 1");
Assert.AreEqual(@"c:\abc\123.txt", IO.GetAbsolutePath(@"c:\abc\efg\", @"..\123.txt"), "Test 1");
Appends a path string to another path string in place
2/7/2012 9:48:00 PM - -171.161.160.10
An IntPtr is a pointer to a memory location (unmanaged) that adapts to the platform it is running on (64-bit, etc.) UNLIKE a standard int/Integer. You should always use this type for unmanaged calls that require it, even though an int will appear to work on your development machine.
1/13/2008 4:00:13 AM - Damon Carr-72.43.165.29
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).