- Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathregkey_queryvalue.cpp
More file actions
Latest commit
16 lines (13 loc) · 513 Bytes
/
Copy pathregkey_queryvalue.cpp
File metadata and controls
16 lines (13 loc) · 513 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include"winapi.h"
usingnamespaceWinAPI;
intRegKey::QueryValue( LPCTSTR lpValueName, string* p_string, LPDWORD lpType ) const
{
*p_string = "";
DWORD data_size = 0;
constint retval = QueryValueSize( lpValueName, &data_size, lpType );
if ( retval != ERROR_SUCCESS ) return retval;
p_string->resize( data_size );
constint retval2 = QueryValue( lpValueName, &(*p_string)[0], &data_size );
if ( retval2 == ERROR_SUCCESS ) p_string->resize( p_string->length() - 1 );
return retval2;
}