Skip to content

Commit 43b0e1f

Browse files
fenxuTaojunshenopbld17colin-homeopbld16
authored
Confirm merge from FromPublicMasterBranch to main to sync with https://github.com/MicrosoftDocs/cpp-docs (branch main) (MicrosoftDocs#4571)
* 10/11/2022 AM Publish (#4570) * Document ARM64 unwind handling for return address signing * Update date, fix step numbers * Fix style, grammar in Arm64 Exception Co-authored-by: opbld17 <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: Martin Storsjö <[email protected]> Co-authored-by: prmerger-automator[bot] <40007230+prmerger-automator[bot]@users.noreply.github.com> * example needed to mitigate dev floundering (MicrosoftDocs#4210) It is not easy to match up variant vt types with POD types. Especially since there is a gradual transition to modern C++. I used a number of dev hours on attempts to match the variant type, vt, to make the true/false work. The m_bValue type for the simple property was a BOOL type, but trying to create a variant of type BOOL directly didn't work. Only by looking at VC Sample code for VisualStudioDemo did I see the (_variant_t)true construct, which becomes the standard_cast contruct in modern C++. I figured my Example code could make other programmer's efforts easier. Co-authored-by: Taojunshen <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: Colin Robertson <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: Martin Storsjö <[email protected]> Co-authored-by: prmerger-automator[bot] <40007230+prmerger-automator[bot]@users.noreply.github.com> Co-authored-by: rtischer8277 <[email protected]>
1 parent b0ce95d commit 43b0e1f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

docs/mfc/reference/cmfcpropertygridproperty-class.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1513,7 +1513,17 @@ Sets the value of a property grid property.
15131513
```
15141514
virtual void SetValue(const _variant_t& varValue);
15151515
```
1516-
1516+
Example:
1517+
```
1518+
void SetPropBarValue( UINT propId, const DWORD& barPropDwordValue )
1519+
{
1520+
auto property = propertiesGridCtrlList.FindItemByData( propId );
1521+
if( property )
1522+
{
1523+
property->SetValue( static_cast< _variant_t >( barPropDwordValue == 1 ) ); // sets property bar value to true or false depending on dword value
1524+
}
1525+
}
1526+
```
15171527
### Parameters
15181528
15191529
*`varValue`*\

0 commit comments

Comments
 (0)