Click here to Skip to main content
15,921,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Is possible to allocate strictly physical mem.(RAM) instead of virtual (page file) Pin
Stephen Hewitt12-Apr-07 14:05
Stephen Hewitt12-Apr-07 14:05 
AnswerRe: Is possible to allocate strictly physical mem.(RAM) instead of virtual (page file) Pin
Nemanja Trifunovic12-Apr-07 11:08
Nemanja Trifunovic12-Apr-07 11:08 
AnswerRe: Is possible to allocate strictly physical mem.(RAM) instead of virtual (page file) Pin
sanket.patel12-Apr-07 16:13
sanket.patel12-Apr-07 16:13 
GeneralRe: Is possible to allocate strictly physical mem.(RAM) instead of virtual (page file) Pin
marcelse13-Apr-07 2:23
marcelse13-Apr-07 2:23 
GeneralRe: Is possible to allocate strictly physical mem.(RAM) instead of virtual (page file) Pin
marcelse13-Apr-07 9:49
marcelse13-Apr-07 9:49 
QuestionUnable to Create Registry Keys in some systems. Pin
Super Hornet12-Apr-07 4:36
Super Hornet12-Apr-07 4:36 
AnswerRe: Unable to Create Registry Keys in some systems. Pin
Gospodin Baron12-Apr-07 4:44
Gospodin Baron12-Apr-07 4:44 
QuestionRe: Unable to Create Registry Keys in some systems. Pin
Super Hornet12-Apr-07 5:14
Super Hornet12-Apr-07 5:14 
But I can create registry entries manually but unable to create through code in some systems
If Admin privilages would be the problem how do i give permission to create registry entries through code?

The code what i have written is:


DWORD dwMaxLength = MAX_COMPUTERNAME_LENGTH + 1;
char szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
GetComputerName(szComputerName, &dwMaxLength);

HKEY hHeadKey;
if(RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\Database", 0, KEY_QUERY_VALUE,&hHeadKey) == ERROR_SUCCESS)
TRACE("Key exists in registry");
else if (RegConnectRegistry(szComputerName,HKEY_LOCAL_MACHINE,&hHeadKey) == ERROR_SUCCESS)
{
HKEY hSubKey1, hSubKey2;

if (RegCreateKeyEx(hHeadKey,"SOFTWARE\\Database",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hSubKey1,NULL) == ERROR_SUCCESS)
{
CString str = "SOME TEXT";
RegSetValueEx(hSubKey1,"Key1",0,REG_SZ,(const unsigned char *)(LPCSTR)str,str.GetLength() + 1);
}

if (RegCreateKeyEx(hHeadKey,"SOFTWARE\\Database",0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hSubKey2,NULL) == ERROR_SUCCESS)
{
CString str = "SOME TEXT";
RegSetValueEx(hSubKey2,"Key2",0,REG_SZ,(const unsigned char *)(LPCSTR)str,str.GetLength() + 1);
}
}

AnswerRe: Unable to Create Registry Keys in some systems. Pin
Gospodin Baron12-Apr-07 5:21
Gospodin Baron12-Apr-07 5:21 
GeneralRe: Unable to Create Registry Keys in some systems. Pin
Super Hornet12-Apr-07 5:51
Super Hornet12-Apr-07 5:51 
AnswerRe: Unable to Create Registry Keys in some systems. Pin
Roger Stoltz12-Apr-07 4:44
Roger Stoltz12-Apr-07 4:44 
GeneralRe: Unable to Create Registry Keys in some systems. Pin
Super Hornet12-Apr-07 5:12
Super Hornet12-Apr-07 5:12 
GeneralRe: Unable to Create Registry Keys in some systems. Pin
Roger Stoltz12-Apr-07 5:29
Roger Stoltz12-Apr-07 5:29 
GeneralRe: Unable to Create Registry Keys in some systems. Pin
Super Hornet12-Apr-07 5:55
Super Hornet12-Apr-07 5:55 
GeneralRe: Unable to Create Registry Keys in some systems. Pin
bob1697212-Apr-07 9:03
bob1697212-Apr-07 9:03 
QuestionCString class problem with STL Pin
prithaa12-Apr-07 4:01
prithaa12-Apr-07 4:01 
AnswerRe: CString class problem with STL Pin
Parthi_Appu12-Apr-07 4:08
Parthi_Appu12-Apr-07 4:08 
AnswerRe: CString class problem with STL Pin
Cedric Moonen12-Apr-07 4:10
Cedric Moonen12-Apr-07 4:10 
GeneralRe: CString class problem with STL Pin
toxcct12-Apr-07 4:12
toxcct12-Apr-07 4:12 
GeneralRe: CString class problem with STL Pin
Cedric Moonen12-Apr-07 4:17
Cedric Moonen12-Apr-07 4:17 
GeneralRe: CString class problem with STL Pin
toxcct12-Apr-07 4:18
toxcct12-Apr-07 4:18 
GeneralRe: CString class problem with STL Pin
Cedric Moonen12-Apr-07 4:23
Cedric Moonen12-Apr-07 4:23 
JokeRe: CString class problem with STL Pin
toxcct12-Apr-07 4:30
toxcct12-Apr-07 4:30 
GeneralRe: CString class problem with STL Pin
prithaa16-Apr-07 8:26
prithaa16-Apr-07 8:26 
QuestionHELP Pin
bbvnvbnbnbnbn12-Apr-07 3:46
bbvnvbnbnbnbn12-Apr-07 3:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.