PathAppendPathAppend*
*Contents  *Index  *Topic Contents
*Previous Topic: PathAddExtension
*Next Topic: PathBuildRoot

PathAppend


BOOL PathAppend(
    LPTSTR  pPath,
    LPCTSTR pMore
    );

Appends one path to the end of another.

pPath
Address of the string to which the file name will be appended.
pMore
Address of the string that represents the file name.

Example:

#include <windows.h>
#include <iostream.h>
#include "Shlwapi.h"

void main( void )
{
	// String for path name.
	char buffer_1[] = "name_1\\name_2";
	char *lpStr1;
	lpStr1 = buffer_1;

	// String of what is being added.
	char buffer_2[] = "name_3";
	char *lpStr2;
	lpStr2 = buffer_2;

cout << "The original path string is    " << lpStr1 << endl;
cout << "The part to append to end is   " << lpStr2 << endl;
bool ret = PathAppend(lpStr1,lpStr2);
cout << "The appended path string is    " << lpStr1 << endl;
}

OUTPUT:
--------- 
The original path string is    name_1\name_2
The part to append to end is   name_3
The appended path string is    name_1\name_2\name_3

Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.