Solved

RegSaveKey fails

Posted on 1997-07-20
5
386 Views
Last Modified: 2013-12-03
Under NT 4.0,Visual c++ 4.1.
RegSaveKey always fails (given a valid handle, path for file that doesn't exist, and NULL for security attrib.)
I need: a possible explanation + a working source code example using the RegSaveKey and its compliant RegRestoreKey.
TIA.
Lilach
0
Comment
Question by:lilach
  • 3
5 Comments
 

Author Comment

by:lilach
ID: 1401356
Edited text of question
0
 
LVL 4

Expert Comment

by:AVaulin
ID: 1401357
Be sure that you pass valid directory for file that doesn't exist. For example you pass "c:\dir1\subdir1\file.reg" but there is no "subdir1" subdirectory in "c:\dir1" or there is no "dir1" directory on "c:" drive. "RegSaveKey" function can't create new directory.
0
 

Author Comment

by:lilach
ID: 1401358
1.OfCourse the directory exists.
2.I asked for a working source code..
 
0
 

Author Comment

by:lilach
ID: 1401359
I checked under win95 ,and it works.

0
 
LVL 1

Accepted Solution

by:
pcs071997 earned 150 total points
ID: 1401360
The calling process must have the SE_BACKUP_NAME privilege. For more information about privileges, see Privileges(in visual c++ online help).
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Run Program using VBScript 3 65
Issue testing the Class Library 4 55
ODBC Connection; Switch between 2 SQL Databases VBA 11 91
Need to impress with my knowledge of .NET 5 90
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question