views:

157

answers:

3

Does the Win32 API have a function for joining two paths?

I can't find it, so I thought I'd ask before rolling my own.

+2  A: 

I'm not sure what you mean by joining two paths, but you can use CreateSymbolicLink to link one directory to another. Another option is CreateHardLink which is a way to gives files more than one name. There are also junctions available which are yet another way to link directories.

Note that all of these are yet different from the more user-friendly shortcut (*.lnk) files that get interpreted by the shell.

If you don't have to do this from code, use SysInternals' (now Microsoft's) Junction utility.

Eclipse
I think the OP is looking for a way to combine Paths as strings, not actually combine paths in the file system
JaredPar
That makes way more sense!
Eclipse
+7  A: 

Maybe you want the functionality of PathCombine from Shell Path Handling Functions.

RoMa
A: 

Using Win32 API you must do all the work, implementing all the logic.

lsalamon