You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -52,7 +51,7 @@ class CComVariant : public tagVARIANT
52
51
53
52
## Remarks
54
53
55
-
`CComVariant` wraps the `VARIANT` and `VARIANTARG` type, which consists of a union and a member indicating the type of the data stored in the union. VARIANTs are typically used in Automation.
54
+
`CComVariant` wraps the `VARIANT` and `VARIANTARG` type, which consists of a union and a member indicating the type of the data stored in the union. `VARIANT`s are typically used in Automation.
56
55
57
56
`CComVariant` derives from the `VARIANT` type so it can be used wherever a `VARIANT` can be used. You can, for example, use the `V_VT` macro to extract the type of a `CComVariant` or you can access the `vt` member directly just as you can with a `VARIANT`.
58
57
@@ -63,7 +62,7 @@ class CComVariant : public tagVARIANT
[in] A pointer to the `VARIANT` whose value is converted to the new type. The default value is NULL, meaning the `CComVariant` object is converted in place.
185
+
[in] A pointer to the `VARIANT` whose value is converted to the new type. The default value is `NULL`, meaning the `CComVariant` object is converted in place.
187
186
188
187
### Return value
189
188
@@ -270,7 +269,7 @@ The contents of the `VARIANT` referenced by *`pDest`* are automatically cleared
270
269
271
270
## <a name="getsize"></a> `CComVariant::GetSize`
272
271
273
-
For simple-fixed size VARIANTs, this method returns the **`sizeof`** value for the underlying data type plus `sizeof(VARTYPE)`.
272
+
For simple-fixed size `VARIANT`s, this method returns the **`sizeof`** value for the underlying data type plus `sizeof(VARTYPE)`.
274
273
275
274
```cpp
276
275
ULONG GetSize() const;
@@ -282,9 +281,9 @@ The size in bytes of the current contents of the `CComVariant` object.
282
281
283
282
### Remarks
284
283
285
-
If the `VARIANT` contains an interface pointer, `GetSize` queries for `IPersistStream` or `IPersistStreamInit`. If successful, the return value is the low-order 32 bits of the value returned by `GetSizeMax` plus `sizeof(CLSID)` and `sizeof(VARTYPE)`. If the interface pointer is NULL, `GetSize` returns `sizeof(CLSID)` plus `sizeof(VARTYPE)`. If the total size is larger than `ULONG_MAX`, `GetSize` returns `sizeof(VARTYPE)`, which indicates an error.
284
+
If the `VARIANT` contains an interface pointer, `GetSize` queries for `IPersistStream` or `IPersistStreamInit`. If successful, the return value is the low-order 32 bits of the value returned by `GetSizeMax` plus `sizeof(CLSID)` and `sizeof(VARTYPE)`. If the interface pointer is `NULL`, `GetSize` returns `sizeof(CLSID)` plus `sizeof(VARTYPE)`. If the total size is larger than `ULONG_MAX`, `GetSize` returns `sizeof(VARTYPE)`, which indicates an error.
286
285
287
-
In all other cases, a temporary `VARIANT` of type `VT_BSTR` is coerced from the current `VARIANT`. The length of this `BSTR` is calculated as the size of the length of the string plus the length of the string itself plus the size of the null character plus `sizeof(VARTYPE)`. If the `VARIANT`cannot be coerced to a `VARIANT` of type `VT_BSTR`, `GetSize` returns `sizeof(VARTYPE)`.
286
+
In all other cases, a temporary `VARIANT` of type `VT_BSTR` is coerced from the current `VARIANT`. The length of this `BSTR` is calculated as the size of the length of the string plus the length of the string itself plus the size of the `NULL` character plus `sizeof(VARTYPE)`. If the `VARIANT`can’t be coerced to a `VARIANT` of type `VT_BSTR`, `GetSize` returns `sizeof(VARTYPE)`.
288
287
289
288
The size returned by this method matches the number of bytes used by [`CComVariant::WriteToStream`](#writetostream) under successful conditions.
helpviewer_keywords: ["fscanf function", "fwscanf function", "formatted data [C++], reading from streams", "ftscanf_l function", "_ftscanf_l function", "_fwscanf_l function", "data [CRT], reading from streams", "_fscanf_l function", "ftscanf function", "fscanf_l function", "streams [C++], reading formatted data from", "_ftscanf function", "fwscanf_l function"]
11
-
ms.assetid: 9004e978-6c5f-4bb2-98fd-51e5948933f2
12
11
---
13
-
# fscanf, _fscanf_l, fwscanf, _fwscanf_l
12
+
# `fscanf`, `_fscanf_l`, `fwscanf`, `_fwscanf_l`
14
13
15
-
Read formatted data from a stream. More secure versions of these functions are available; see [fscanf_s, _fscanf_s_l, fwscanf_s, _fwscanf_s_l](fscanf-s-fscanf-s-l-fwscanf-s-fwscanf-s-l.md).
14
+
Read formatted data from a stream. More secure versions of these functions are available; see [`fscanf_s`, `_fscanf_s_l`, `fwscanf_s`, `_fwscanf_s_l`](fscanf-s-fscanf-s-l-fwscanf-s-fwscanf-s-l.md).
16
15
17
16
## Syntax
18
17
@@ -43,47 +42,47 @@ int _fwscanf_l(
43
42
44
43
### Parameters
45
44
46
-
*stream*<br/>
47
-
Pointer to **FILE** structure.
45
+
*`stream`*\
46
+
Pointer to **`FILE`** structure.
48
47
49
-
*format*<br/>
48
+
*`format`*\
50
49
Format-control string.
51
50
52
-
*argument*<br/>
51
+
*`argument`*\
53
52
Optional arguments.
54
53
55
-
*locale*<br/>
54
+
*`locale`*\
56
55
The locale to use.
57
56
58
57
## Return Value
59
58
60
-
Each of these functions returns the number of fields successfully converted and assigned; the return value does not include fields that were read but not assigned. A return value of 0 indicates that no fields were assigned. If an error occurs, or if the end of the file stream is reached before the first conversion, the return value is **EOF** for **fscanf** and **fwscanf**.
59
+
Each of these functions returns the number of fields successfully converted and assigned; the return value doesn't include fields that were read but not assigned. A return value of 0 indicates that no fields were assigned. If an error occurs, or if the end of the file stream is reached before the first conversion, the return value is **`EOF`** for **`fscanf`** and **`fwscanf`**.
61
60
62
-
These functions validate their parameters. If *stream* or *format* is a null pointer, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions return **EOF** and set **errno** to **EINVAL**.
61
+
These functions validate their parameters. If *`stream`* or *`format`* is a `NULL` pointer, the invalid parameter handler is invoked, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md). If execution is allowed to continue, these functions return **`EOF`** and set **`errno`** to **`EINVAL`**.
63
62
64
63
## Remarks
65
64
66
-
The **fscanf** function reads data from the current position of *stream* into the locations given by *argument* (if any). Each *argument* must be a pointer to a variable of a type that corresponds to a type specifier in *format*. *format* controls the interpretation of the input fields and has the same form and function as the *format* argument for **scanf**; see [scanf](scanf-scanf-l-wscanf-wscanf-l.md) for a description of *format*.
65
+
The **`fscanf`** function reads data from the current position of *`stream`* into the locations given by *`argument`* (if any). Each *`argument`* must be a pointer to a variable of a type that corresponds to a type specifier in *`format`*. *`format`* controls the interpretation of the input fields and has the same form and function as the *`format`* argument for **`scanf`**; see [`scanf`](scanf-scanf-l-wscanf-wscanf-l.md) for a description of *`format`*.
67
66
68
-
**fwscanf** is a wide-character version of **fscanf**; the format argument to **fwscanf** is a wide-character string. These functions behave identically if the stream is opened in ANSI mode. **fscanf** doesn't currently support input from a UNICODE stream.
67
+
**`fwscanf`** is a wide-character version of **`fscanf`**; the format argument to **`fwscanf`** is a wide-character string. These functions behave identically if the stream is opened in ANSI mode. **`fscanf`** doesn't currently support input from a UNICODE stream.
69
68
70
-
The versions of these functions with the **_l** suffix are identical except that they use the locale parameter passed in instead of the current thread locale.
69
+
The versions of these functions with the **`_l`** suffix are identical except that they use the locale parameter passed in instead of the current thread locale.
71
70
72
71
### Generic-Text Routine Mappings
73
72
74
-
|TCHAR.H routine|_UNICODE & _MBCS not defined|_MBCS defined|_UNICODE defined|
73
+
|`TCHAR.H` routine|`_UNICODE & _MBCS` not defined|`_MBCS` defined|`_UNICODE` defined|
For more information, see [Format Specification Fields - scanf functions and wscanf Functions](../../c-runtime-library/format-specification-fields-scanf-and-wscanf-functions.md).
78
+
For more information, see [Format Specification Fields - `scanf` functions and `wscanf` Functions](../../c-runtime-library/format-specification-fields-scanf-and-wscanf-functions.md).
80
79
81
80
## Requirements
82
81
83
82
|Function|Required header|
84
83
|--------------|---------------------|
85
-
|**fscanf**, **_fscanf_l**|\<stdio.h>|
86
-
|**fwscanf**, **_fwscanf_l**|\<stdio.h> or \<wchar.h>|
84
+
|**`fscanf`**, **`_fscanf_l`**|`<stdio.h>`|
85
+
|**`fwscanf`**, **`_fwscanf_l`**|`<stdio.h>` or `<wchar.h>`|
87
86
88
87
For additional compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
Creates an absolute or full path name for the specified relative path name.
16
15
@@ -31,55 +30,55 @@ wchar_t *_wfullpath(
31
30
32
31
### Parameters
33
32
34
-
*absPath*<br/>
35
-
Pointer to a buffer containing the absolute or full path name, or **NULL**.
33
+
*`absPath`*\
34
+
Pointer to a buffer containing the absolute or full path name, or **`NULL`**.
36
35
37
-
*relPath*<br/>
36
+
*`relPath`*\
38
37
Relative path name.
39
38
40
-
*maxLength*<br/>
41
-
Maximum length of the absolute path name buffer (*absPath*). This length is in bytes for **_fullpath** but in wide characters (**`wchar_t`**) for **_wfullpath**.
39
+
*`maxLength`*\
40
+
Maximum length of the absolute path name buffer (*`absPath`*). This length is in bytes for **`_fullpath`** but in wide characters (**`wchar_t`**) for **`_wfullpath`**.
42
41
43
42
## Return Value
44
43
45
-
Each of these functions returns a pointer to a buffer containing the absolute path name (*absPath*). If there is an error (for example, if the value passed in *relPath* includes a drive letter that is not valid or cannot be found, or if the length of the created absolute path name (*absPath*) is greater than *maxLength*), the function returns **NULL**.
44
+
Each of these functions returns a pointer to a buffer containing the absolute path name (*`absPath`*). If there's an error (for example, if the value passed in *`relPath`* includes a drive letter that isn't valid or can’t be found, or if the length of the created absolute path name (*`absPath`*) is greater than *`maxLength`*), the function returns **`NULL`**.
46
45
47
46
## Remarks
48
47
49
-
The **_fullpath** function expands the relative path name in *relPath* to its fully qualified or absolute path and stores this name in *absPath*. If *absPath* is **NULL**, **malloc** is used to allocate a buffer of sufficient length to hold the path name. It is the responsibility of the caller to free this buffer. A relative path name specifies a path to another location from the current location (such as the current working directory: "."). An absolute path name is the expansion of a relative path name that states the entire path required to reach the desired location from the root of the file system. Unlike **_makepath**, **_fullpath** can be used to obtain the absolute path name for relative paths (*relPath*) that include "./" or "../" in their names.
48
+
The **`_fullpath`** function expands the relative path name in *`relPath`* to its fully qualified or absolute path and stores this name in *`absPath`*. If *`absPath`* is **`NULL`**, **`malloc`** is used to allocate a buffer of sufficient length to hold the path name. It's the responsibility of the caller to free this buffer. A relative path name specifies a path to another location from the current location (such as the current working directory: `.`). An absolute path name is the expansion of a relative path name that states the entire path required to reach the desired location from the root of the file system. Unlike **`_makepath`**, **`_fullpath`** can be used to obtain the absolute path name for relative paths (*`relPath`*) that include `./` or `../` in their names.
50
49
51
-
For example, to use C run-time routines, the application must include the header files that contain the declarations for the routines. Each header file include statement references the location of the file in a relative manner (from the application's working directory):
50
+
For example, to use C run-time routines, the application must include the header files that contain the declarations for the routines. Each header file `#include` directive references the location of the file in a relative manner (from the application's working directory):
52
51
53
52
```C
54
-
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
55
-
56
53
#include<stdlib.h>
57
54
```
58
55
59
56
when the absolute path (actual file system location) of the file might be:
**_fullpath** automatically handles multibyte-character string arguments as appropriate, recognizing multibyte-character sequences according to the multibyte code page currently in use. **_wfullpath** is a wide-character version of **_fullpath**; the string arguments to **_wfullpath** are wide-character strings. **_wfullpath** and **_fullpath** behave identically except that **_wfullpath** does not handle multibyte-character strings.
60
+
By default, this function's global state is scoped to the application. To change this, see [Global state in the CRT](../global-state.md).
61
+
62
+
**`_fullpath`** automatically handles multibyte-character string arguments as appropriate, recognizing multibyte-character sequences according to the multibyte code page currently in use. **`_wfullpath`** is a wide-character version of **`_fullpath`**; the string arguments to **`_wfullpath`** are wide-character strings. **`_wfullpath`** and **`_fullpath`** behave identically except that **`_wfullpath`** doesn't handle multibyte-character strings.
64
63
65
-
If **_DEBUG** and **_CRTDBG_MAP_ALLOC** are both defined, calls to **_fullpath** and **_wfullpath** are replaced by calls to **_fullpath_dbg** and **_wfullpath_dbg** to allow for debugging memory allocations. For more information, see [_fullpath_dbg, _wfullpath_dbg](fullpath-dbg-wfullpath-dbg.md).
64
+
If **`_DEBUG`** and **`_CRTDBG_MAP_ALLOC`** are both defined, calls to **`_fullpath`** and **`_wfullpath`** are replaced by calls to **`_fullpath_dbg`** and **`_wfullpath_dbg`** to allow for debugging memory allocations. For more information, see [`_fullpath_dbg`, `_wfullpath_dbg`](fullpath-dbg-wfullpath-dbg.md).
66
65
67
-
This function invokes the invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md), if *maxlen* is less than or equal to 0. If execution is allowed to continue, this function sets **errno** to **EINVAL** and returns **NULL**.
66
+
This function invokes the invalid parameter handler, as described in [Parameter Validation](../../c-runtime-library/parameter-validation.md), if *`maxlen`* is less than or equal to 0. If execution is allowed to continue, this function sets **`errno`** to **`EINVAL`** and returns **`NULL`**.
68
67
69
68
### Generic-Text Routine Mappings
70
69
71
-
|Tchar.h routine|_UNICODE and _MBCS not defined|_MBCS defined|_UNICODE defined|
70
+
|`Tchar.h` routine|`_UNICODE and _MBCS` not defined|`_MBCS` defined|`_UNICODE` defined|
If the *absPath* buffer is **NULL**, **_fullpath** calls [malloc](malloc.md) to allocate a buffer and ignores the *maxLength* argument. It is the caller's responsibility to deallocate this buffer (using [free](free.md)) as appropriate. If the *relPath* argument specifies a disk drive, the current directory of this drive is combined with the path.
74
+
If the *`absPath`* buffer is **`NULL`**, **`_fullpath`** calls [`malloc`](malloc.md) to allocate a buffer and ignores the *`maxLength`* argument. It's the caller's responsibility to deallocate this buffer (using [`free`](free.md)) as appropriate. If the *`relPath`* argument specifies a disk drive, the current directory of this drive is combined with the path.
76
75
77
76
## Requirements
78
77
79
78
|Function|Required header|
80
79
|--------------|---------------------|
81
-
|**_fullpath**|\<stdlib.h>|
82
-
|**_wfullpath**|\<stdlib.h> or \<wchar.h>|
80
+
|**`_fullpath`**|`<stdlib.h>`|
81
+
|**`_wfullpath`**|`<stdlib.h>` or `<wchar.h>`|
83
82
84
83
For more compatibility information, see [Compatibility](../../c-runtime-library/compatibility.md).
85
84
@@ -120,8 +119,8 @@ Full path is: C:\Documents and Settings\user\test
0 commit comments