A Globally Unique Identifier or GUID (pronounced /ˈguːɪd/ or /ˈgwɪd/) is a special type of identifier used in software applications in order to provide a reference number which is unique in any context (hence, "Globally"), for example, in defining the internal reference for a type of access point in a software application, or for creating unique keys in a database. While each generated GUID is not guaranteed to be unique, the total number of unique keys (2128 or 3.4×1038) is so large that the probability of the same number being generated twice is very small. For example, consider the observable universe, which contains about 5×1022 stars; every star could then have 6.8×1015 universally unique GUIDs.
The term GUID usually refers to Microsoft's implementation of the Universally Unique Identifier (UUID) standard. Many systems use the term GUID, however, including Oracle Database, MySQL, dBase, OpenView Operations, ISIS Papyrus, and Novell eDirectory. The GUID is also the basis of the GUID Partition Table, Intel's replacement for Master Boot Records under EFI.
HKEY m_hKey; // create a HKEY
CRegKey key; // create a CRegKey
char *szValue; // pointer to receive the
DWORD *pdwCount; // to get the buffer length
CString keyVal = "defaultvalue";
if( key.Open(m_hKey, "HKEY_LOCAL_MACHINE\\Software\\GSAT\\QuotaMan", KEY_READ) == ERROR_SUCCESS) // open the key
{
if(key.QueryValue( szValue, "keyVal", pdwCount )) // see if there is a value
{
keyVal=szValue; // if there is, set the variable
Log( "Got keyVal = " + szValue ); // just a function to write output to a text file
}
key.Close();
}
Voltar para Visual C++/C/C++/C#
Usuários navegando neste fórum: Nenhum usuário registrado e 1 visitante