Solved

RegSaveKey fails

Posted on 1997-07-20
5
394 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
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…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

728 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