ShlwApiPathAddExtension Method
Note: This API is now obsolete.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("ShlwApi.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
[ObsoleteAttribute("Misuse of this function can lead to a buffer overrun. We recommend the use of the safer NativeMethods.PathCchAddExtension function in its place.",
false)]
public static bool PathAddExtension(
StringBuilder path,
string ext
)
<DllImportAttribute("ShlwApi.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
<ObsoleteAttribute("Misuse of this function can lead to a buffer overrun. We recommend the use of the safer NativeMethods.PathCchAddExtension function in its place.",
false)>
Public Shared Function PathAddExtension (
path As StringBuilder,
ext As String
) As Boolean
Dim path As StringBuilder
Dim ext As String
Dim returnValue As Boolean
returnValue = ShlwApi.PathAddExtension(path,
ext)
public:
[DllImportAttribute(L"ShlwApi.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
[ObsoleteAttribute(L"Misuse of this function can lead to a buffer overrun. We recommend the use of the safer NativeMethods.PathCchAddExtension function in its place.",
false)]
static bool PathAddExtension(
StringBuilder^ path,
String^ ext
)
[<DllImportAttribute("ShlwApi.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
[<ObsoleteAttribute("Misuse of this function can lead to a buffer overrun. We recommend the use of the safer NativeMethods.PathCchAddExtension function in its place.",
false)>]
static member PathAddExtension :
path : StringBuilder *
ext : string -> bool
No code example is currently available or this language may not be supported.
- path StringBuilder
-
A pointer to a buffer with the null-terminated string to which the file name extension will be appended.
You must set the size of this buffer to MAX_PATH to ensure that it is large enough to hold the returned string.
- ext String
-
A pointer to a null-terminated string that contains the file name extension. This value can be NULL.
Boolean
Returns
if an extension was added, or
otherwise.