load_default_checkboxes

 

Description

Receive a array of boolean values saved by save_default_checkboxes in the registry.

Syntax

bool load_default_checkboxes( LPCSTR lpcszDlgName, vector<byte> & vbValues, LPCSTR lpcszValName = NULL )

Parameters

lpcszDlgName
[input]name of the dialog, this is used as the section name in the registry under /Dialogs/lpcszDlgName
vbValues
[output]array of 1 and 0 that each will represent each bit in the DWORD value saved into registry
lpcszValName
[input]Value name in registry to save, if not specified, CheckBoxes will be used

Return

True for success, false if lpcszDlgName section does not have the item in registry.

Examples

EX1

#include <GetNBox.h>
void load_default_checkboxes_Ex1()
{
    vector<byte> vbValues ;
        
    LPCSTR dlgName="testDlg2" ;
    LPCSTR valueName="Testing";
        
        
    GETN_TREE(tr)
                GETN_CHECK(CH1, "college",false)
                GETN_CHECK(CH2,"family", true)
                GETN_CHECK(CH3, "society",false)
        
        //initialize tree value for defalut setting 
    if(load_default_checkboxes(dlgName,vbValues,valueName))
    {
        tr.CH1.nVal=vbValues[0];
        tr.CH2.nVal=vbValues[1];
        tr.CH3.nVal=vbValues[2];
    }
    
    // save tree value to Registry.
    if(GetNBox(tr,dlgName))
    {
        vbValues.SetSize(0);
        vbValues.Add(tr.CH1.nVal);
        vbValues.Add(tr.CH2.nVal);
        vbValues.Add(tr.Ch3.nVal);
        if(!save_default_checkboxes(dlgName,vbValues,valueName))
                printf("failed to save user's choice\n");
                
    }
    else
        printf("usr click cancel\n");
}

Remark

See Also

save_default_checkboxes

header to Include

origin.h

Reference