Solved

RegSaveKey fails

Posted on 1997-07-20
5
376 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now