Click here to Skip to main content
16,010,416 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to set quota limits of disk in VC++ Pin
Tida15-Aug-02 3:00
Tida15-Aug-02 3:00 
GeneralRegistry script problem Pin
pankajdaga15-Aug-02 2:53
pankajdaga15-Aug-02 2:53 
GeneralRe: Registry script problem Pin
Jon Hulatt16-Aug-02 2:32
Jon Hulatt16-Aug-02 2:32 
Questiondynamic button on CFormView Child ?? Pin
AlinRO15-Aug-02 2:30
AlinRO15-Aug-02 2:30 
AnswerRe: dynamic button on CFormView Child ?? Pin
Roger Allen15-Aug-02 3:56
Roger Allen15-Aug-02 3:56 
Questiondynamic button on CFormView ??? Pin
AlinRO15-Aug-02 2:29
AlinRO15-Aug-02 2:29 
AnswerRe: dynamic button on CFormView ??? Pin
Alberto Giannetto15-Aug-02 3:48
Alberto Giannetto15-Aug-02 3:48 
GeneralRegistry problem... Pin
code dope15-Aug-02 1:08
code dope15-Aug-02 1:08 
I'm producing a Web Viewer so that our customers can view the Images that we scan for them from anywhere. They enter the site and perform a search for the images and then view them. Their search details are saved in the Web Server's Registry and the fields(text boxes) are populated with their last query the next time they enter the site. The site is writen using ASP, Javascript and an ISAPI extension dll, using MFC, that does all the database stuff and file handling etc.

However, although I can read their last query from the registry, I cannot set values. I am using CRegKey::Open, with the access set to KEY_SET_VALUE ( I have tried KEY_WRITE and KEY_ALL_ACCESS ).

The RegConnectRegistry( ) function before it is succeeding OK.

I have tried using GetLastError() and then FormatMessage to get the Error Message but it returns "The operation was successful"!

Oh, the OS is W2k.

Any help would be greatly appreciated.

code as below:

// open the Registry Key and update it...
// connect to the Registry...
if ( RegConnectRegistry( NULL, HKEY_LOCAL_MACHINE , &m_RegKey.m_hKey ) != ERROR_SUCCESS )
{
#ifdef _DEBUG
MessageBox( NULL,"Unable to connect to Registry", "ERROR !", MB_DEFAULT_DESKTOP_ONLY );
#endif
return;
}
// and open (or create and open) the key...
if( m_RegKey.Create( m_RegKey.m_hKey, m_strSubKey, REG_NONE, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL, NULL ) != ERROR_SUCCESS )
{
// if it fails, find out why...
int nGetLastError = GetLastError( );
#ifdef _DEBUG
FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM, NULL, nGetLastError, 0, (LPSTR)szBuffer, 255, NULL );
MessageBox( NULL, szBuffer, "ERROR - SetLastQueryData()", MB_DEFAULT_DESKTOP_ONLY );
#endif
return;
}

Thanx for your patience and any help,


code dope.
GeneralRe: Registry problem... Pin
Anders Molin15-Aug-02 2:08
professionalAnders Molin15-Aug-02 2:08 
GeneralRe: Registry problem... Pin
567890123415-Aug-02 2:34
567890123415-Aug-02 2:34 
GeneralRe: Registry problem... Pin
code dope15-Aug-02 2:54
code dope15-Aug-02 2:54 
GeneralRe: Registry problem... Pin
567890123415-Aug-02 3:20
567890123415-Aug-02 3:20 
GeneralRe: Registry problem... Pin
code dope15-Aug-02 2:50
code dope15-Aug-02 2:50 
GeneralRe: Registry problem... Pin
Anders Molin15-Aug-02 4:23
professionalAnders Molin15-Aug-02 4:23 
GeneralRe: Registry problem... Pin
Ryan B.15-Aug-02 9:00
Ryan B.15-Aug-02 9:00 
GeneralCreate a button on a CReBar Error !! Pin
code_cold15-Aug-02 0:37
code_cold15-Aug-02 0:37 
GeneralRe: Create a button on a CReBar Error !! Pin
Tomasz Sowinski15-Aug-02 1:01
Tomasz Sowinski15-Aug-02 1:01 
GeneralMemory leak Pin
Janine15-Aug-02 0:35
Janine15-Aug-02 0:35 
GeneralRe: Memory leak Pin
Tomasz Sowinski15-Aug-02 0:47
Tomasz Sowinski15-Aug-02 0:47 
GeneralRe: Memory leak Pin
Janine15-Aug-02 0:53
Janine15-Aug-02 0:53 
GeneralRe: Memory leak Pin
Tomasz Sowinski15-Aug-02 1:00
Tomasz Sowinski15-Aug-02 1:00 
GeneralRe: Memory leak Pin
Janine15-Aug-02 1:52
Janine15-Aug-02 1:52 
GeneralRe: Memory leak Pin
Tomasz Sowinski15-Aug-02 2:22
Tomasz Sowinski15-Aug-02 2:22 
GeneralRe: Memory leak Pin
Janine15-Aug-02 2:47
Janine15-Aug-02 2:47 
GeneralRe: Memory leak Pin
Steen Krogsgaard15-Aug-02 3:39
Steen Krogsgaard15-Aug-02 3:39 

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.