Click here to Skip to main content
15,897,187 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Macro or another Way Pin
Grahamfff27-Aug-04 21:52
Grahamfff27-Aug-04 21:52 
GeneralRe: Macro or another Way Pin
David Crow28-Aug-04 17:24
David Crow28-Aug-04 17:24 
GeneralRe: Macro or another Way Pin
Grahamfff30-Aug-04 9:24
Grahamfff30-Aug-04 9:24 
GeneralRe: Macro or another Way Pin
Bob Stanneveld28-Aug-04 7:40
Bob Stanneveld28-Aug-04 7:40 
GeneralsaveFileDialog Pin
jet91527-Aug-04 10:04
jet91527-Aug-04 10:04 
GeneralRe: saveFileDialog Pin
Maximilien27-Aug-04 10:14
Maximilien27-Aug-04 10:14 
GeneralRe: saveFileDialog Pin
toxcct28-Aug-04 7:58
toxcct28-Aug-04 7:58 
GeneralRegistry Corruption Pin
aman200627-Aug-04 9:10
aman200627-Aug-04 9:10 
Hi
I am writing a program which Creates Three entries into the windows registry but on some systems instead of creating the registry it locks the registry HKEY_LOCAL_MACHINE\SOFTWARE part and shows error "Access is denied" and after that it does not allow to create a entry into the registry, it seems that registry got corrupted but windows still works fine. I don't know. Is it the problem of Rights to write into the registrry or something else.This program works fine on my machine but does not works on some machines. Please help...

BOOL CGenUniqueKeyXDlg::SaveValueToRegistry(char *pcszValue)
{
DWORD dwLen = 0;
int nReturnVal;
HKEY m_hContextKey;
DWORD dwDisp;

nReturnVal = RegCreateKeyEx(HKEY_LOCAL_MACHINE , //Handle to a currently open key
REG_LOC_PATH, // Sub Key Name
0, //Reserved
NULL,
0,
KEY_WRITE,
NULL,
&m_hContextKey,
&dwDisp );


if(nReturnVal != ERROR_SUCCESS)
{

ShowRegError(nReturnVal);
return FALSE;
}


nReturnVal = RegSetValueEx(m_hContextKey, UNIQUE_KEY, 0, REG_SZ, (PBYTE)pcszValue, (_tcslen(pcszValue) + 1) * sizeof(char));

if(nReturnVal != ERROR_SUCCESS)
{


ShowRegError(nReturnVal);
return FALSE;
}
strcpy(pcszValue,m_SyncURL);//"http://Nopd/CiteCapture/MDCSync.aspx";
nReturnVal = RegSetValueEx(m_hContextKey, URL_KEY, 0, REG_SZ, (PBYTE)pcszValue, (_tcslen(pcszValue) + 1) * sizeof(char));


strcpy(pcszValue,m_Port);
nReturnVal = RegSetValueEx(m_hContextKey, COM_PORT, 0, REG_SZ, (PBYTE)pcszValue, (_tcslen(pcszValue) + 1) * sizeof(char));


RegCloseKey( m_hContextKey );
return TRUE;

}

Any input will be appreciated

Thanks
Shailesh
GeneralRe: Registry Corruption Pin
David Crow27-Aug-04 9:25
David Crow27-Aug-04 9:25 
GeneralRe: Registry Corruption Pin
aman200627-Aug-04 10:42
aman200627-Aug-04 10:42 
GeneralRe: Registry Corruption Pin
David Crow27-Aug-04 11:00
David Crow27-Aug-04 11:00 
GeneralRe: Registry Corruption Pin
Michael Dunn27-Aug-04 21:01
sitebuilderMichael Dunn27-Aug-04 21:01 
QuestionNeed to insert text? Pin
Larsson27-Aug-04 9:04
Larsson27-Aug-04 9:04 
AnswerRe: Need to insert text? Pin
David Crow27-Aug-04 9:33
David Crow27-Aug-04 9:33 
GeneralRe: Need to insert text? Pin
Larsson27-Aug-04 10:03
Larsson27-Aug-04 10:03 
GeneralRe: Need to insert text? Pin
David Crow27-Aug-04 10:38
David Crow27-Aug-04 10:38 
QuestionInsert text to file? Pin
Larsson27-Aug-04 8:44
Larsson27-Aug-04 8:44 
AnswerRe: Insert text to file? Pin
darkbyte27-Aug-04 13:58
darkbyte27-Aug-04 13:58 
GeneralDoc/View and permanent/temporary handle maps Pin
herbert_chow27-Aug-04 8:24
herbert_chow27-Aug-04 8:24 
GeneralRe: Doc/View and permanent/temporary handle maps Pin
Neville Franks27-Aug-04 11:34
Neville Franks27-Aug-04 11:34 
Generalextern "C" in VisualStudio Pin
Marcello27-Aug-04 5:58
Marcello27-Aug-04 5:58 
GeneralRe: extern "C" in VisualStudio Pin
darkbyte27-Aug-04 13:38
darkbyte27-Aug-04 13:38 
GeneralRe: extern "C" in VisualStudio Pin
Marcello27-Aug-04 14:32
Marcello27-Aug-04 14:32 
GeneralRe: extern "C" in VisualStudio Pin
darkbyte27-Aug-04 15:49
darkbyte27-Aug-04 15:49 
GeneralRe: extern "C" in VisualStudio Pin
Marcello28-Aug-04 18:59
Marcello28-Aug-04 18:59 

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.