Why can't I re-import a registry file created by RegSaveKey(...) under Win 9x?

Hello:

I was trying to save a registry key to a file say, "mykey" with help of
RegSaveKey(...) [not RegSaveKeyEx(...)]. The file can be re-imported with
"Regedit" under WinXP if it is produced under Win XP.

But for the same program running under Win 98/95, the files created under
these OSs cannot be re-imported. These files cannot be re-imported under
WinXP.

Can anyone tell me why?

The exerpted code is listed below:

....
 char szSubKey[_MAX_FNAME];
char FileName[_MAX_FNAME];
 long  rc = 0;

 HKEY hKey;

 sprintf(szSubKey, "Software\Mykey");
 sprintf(FileName, "Mykey");


    if (RegCreateKeyEx(
      HKEY_LOCAL_MACHINE,
      szSubKey,
      0,
      NULL,
      REG_OPTION_NON_VOLATILE,
      KEY_ALL_ACCESS,
      NULL,
      &hResult,
      NULL)!=ERROR_SUCCESS)
 {
      MessageBox("Error", "RegCreateKeyEx", MB_OK);
 }

else
 {
      if( (RegSaveKey(hResult, FileName, NULL)  ) != ERROR_SUCCESS)
      {
         MessageBox("Error", "RegSaveKey", MB_OK);
      }

 }

 RegCloseKey(hResult);
....

Can anyone give me some clue?


Thanks in advance.

Ke


0
sdfaf (1)
12/11/2003 7:44:32 AM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies
587 Views

Similar Articles

[PageSpeed] 55

Reply:

Similar Artilces:

Importing from Corel Ventura Publisher
Does anyone know of a way to open a Corel Ventura Publisher document in Microsoft Publisher. Unfortunately due to computer crash and change of job I no longer have access to Corel Ventura Publisher Depending on the type of file, Ventura has all sorts of extensions. It may well be you are out of luck. Have you tried "Recover text from any document" in files of type? What version Ventura? -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "VianneyS" <VianneyS@discussions.microsoft.com> wrote in message news:...

Convert PNG file to Bitmap without a DC?
I'd like to store images resources as PNGs due to the compression over bitmps. To load such a resource and get it converted to a bitmap for the eventual Blit to my screen DC, I basically want the equivalent of LoadBitmap. Better yet, I was thinking I would create a CBitmap derived class "CPNGImage" that would have a "LoadPNGResource" method much like CBitmap's LoadBitmap method. So far so good. The stumbling block for me at this point is that the process of converting the PNG to a bitmap seems to require a DC compatible with my device. This is neatly enc...

CRM 4.0
I've a few issues with CRM 4.0 and I was wondering if you could help me. I created a sample data so you can better understand my needs. "Account Name", "Contact Full Name, Role, Primary Contact, Email "Company 1", "John Smith ", "President", "No", "js@company1.com "Company 1", "Michael Smith", "Director ", "Yes", "mic@company1.com "Company 2", "Wayne Smith", "President", "Yes", "way@company2.com "Company 2", "John Smith &...

Re-arranging table using pivot-table?
I have a worksheet with data organized somewhat like this: New York New York New York Albany Florida Miami Florida Orlando Florida Tampa Florida Jacksonville California Los Angeles California San Diego I need to convert this to a list of states and each city in the columns to the right of their corresponding state. Something like this: New York New York Albany Florida Miami Orlando Tampa Jacksonville California Los Angeles San Diego Any help is greatly appreci...

access file to exe file
Hi, good day! May i know the procedures on how to make access file to an executable file. I read a lot of Access books from 97 to XP versions but i was not able to find any. thank you very much and anticipating your response. Anthony > May i know the procedures on how to make access file to an > executable file. I read a lot of Access books from 97 to > XP versions but i was not able to find any. I tried a number of converters to translate Access into Visual Basic, all with limited success. Even when I was able to get a form working it required as much time to tweek it a...

Saving files when closing Excel
Excel does not prompt for saving changes when closing a file after changes to the file have been done. Hi have you checked that there's no event macro in your file? -- Regards Frank Kabel Frankfurt, Germany Jonathan Gold wrote: > Excel does not prompt for saving changes when closing a file after > changes to the file have been done. ...

Re-install Outlook 2002
I am trying to re-install Outlook 2002 for my palm pilot after a crash. The installation will run until I get the message - "another version is already installed and must be uninstalled". The previous version was corrupt and I was unable to uninstall it. Now when I go into the control panel to add/remove the uninstall is no longer in the listed. Help! ...

Excel Icon for files
I am running Windows 2000 professional on my PC and connected to a LAN. I am running the MS office 2000 Professional suite. When, I save a worksheet from Exel 2000 it does not save the file with the common Excel file Icon(green X). The file is displayed with the default Windows Flag Icon. When I double click on this default Windows Flag Icon the system tries to open the file with Word not Excel. Word and PowerPoint both save with their common Icons. The Excel program saved fine a couple of weeks ago. I have not installed any new software and our server takes care of Virus protection thro...

Re-Enable CRM User
Hello Everyone, I am trying to enable a disabled CRM user and I received the following error message. Any thoughts or suggestions would be greatly appreciated. [COMException (0x80040204)] Microsoft.Crm.Platform.ComProxy.CBizUserClass.Enable(CUserAuth& Caller, String UserId) +0 Microsoft.Crm.Application.Platform.SystemUser.Activate(String id) +38 Microsoft.Crm.Web.BusinessManagement.SystemUserDetailPage.changeState(Object sender, DataEventArgs e) +127 Microsoft.Crm.Application.Forms.DataEventProcessor.Raise(FormEventId eventId, FormState state, User user, String objectId,...

Cell formatting when importing data
When I import data from a delimited file into Excel 2000, even though I have pre-formatted a column as text, entries such as 12-5 and 1-4 -- which are not dates display as dates. When I reapply the text formatting I get a number: 38691. How can I get 12-5 to display as is when I bring the data in? Rename the file to *.txt and use the text import wizard, just click next twice and in step 3 select text from column data format for this particular column and click finish -- Regards, Peo Sjoblom "cjay" <cjay@discussions.microsoft.com> wrote in message news:90AAB750-BF9F...

Create Batch file for laptops to copy templates
Hi Everyone, I am new to batch file programming and need an expert help to find out something. I want to create a batch file that runs at login and compares a local copy of the templates to what we have on the network. We have templates on a mapped network drive in h:\clients\templates, and on the laptop in c:\apps\data\clients\templates. When the laptop is offline it substitutes c:\apps\data to appear as h: drive, that way the files appear to be in h:\clients\templates. Here’s the basic steps what I need the batch file for: 1. first it checks to see if the computer is on th...

RE:Excel will not open from a web link
When opening a link on a web page that has an Excel Spreadsheet embedded in it, the spreadsheet will not open up Excel but opens within another browser as an Excel file. Programming on webpage is correct, opens up on other machines just fine. ...

Thanks Ken Wright but one more question RE saving data from circular references
Thanks heaps for that macro Ken Wright . I have run it and it works. However it loops forever. Can I set it up so that it could save dat from a certain number of iterations? Thanks again Michae -- Message posted from http://www.ExcelForum.com Hi Michael, If you stayed within your thread and did not change the subject Ken would see your reply as a reply to his reply and would see it a lot faster than when you start a new thread. Ken would probably see your post highlighted in RED. Also someone other than Ken might have been able to help you. (not me I avoid anything that hints of circul...

Vlookups to Excel Version 3 files.
I use a system that on a daily basis creates an Excel version 3 file containing cost centers and their budgets. When I do vlookups from other Excel 97 files to this file it takes a long time for the sheet to calculate. If I save the Excel V3 file as Excel 97 its OK, and if the Excel V3 file is open before the 97 file its OK. I don't want to have to constantly save the V3 file as 97 (I may not be around to do that always) Does anyone know how to resolve this. Thanks Naz ...

How do i change my file from a 2003 office doument to a 2000 docu.
i have done this before with a word document but i dont seem to be able to figure out how to do it with a publisher document.... can anybody help?? File, save as, files of type, expand the menu to Publisher 2000. -- Mary Sauer MS MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "me" <me@discussions.microsoft.com> wrote in message news:E89A2FF9-20DD-4568-980F-73162AE7AB8A@microsoft.com... >i have done this before with a word document but i dont seem to be able to > figure out how to do it with a publisher document.... can anybody he...

Re: exmerge error
I am getting the following error when trying to use exmerg can anyone please help *************************************************************** Microsoft Exchange Mailbox Merge Program, v4.00.02 Start Logging:February 27, 2004 20:04:3 *************************************************************** [20:04:31] Logging Level: Non [20:04:31] Reading settings from file 'C:\Program Files\Exchsrvr\BIN\EXMERGE.INI' [20:04:32] Error 8007203a opening an LDAP connection. ('LDAP://EXCHANGE/rootDSE') (CADRoutines::GetNamingContextData [20:04:32] Accessing Domain Controller 'PROFI...

Ron Bovey re: "Trim Selection" in ExcelUtilities
Cells in my Excel spreadsheet appear to be empty. However, when I use Edit/Go To/Special/Blanks, I get "No cells were found". In the past, Ron Bovey suggested going to the WWW.APPROS.COM website, download ExcelUtilities and then use the "Trim Selection" utility to remove the characters that are making the cells not empty. Since then, I've gone to the WWW.APPROS.COM website and downloaded the ASAP Utilities. However, I can seem to find the "Trim Selection" nor any utility that will do the same thing. Help! Try going to Rob (not Ron) Bovey's site: ...

Register a file extension
I would like to allow my users to register my apps file extension from within the app. I have managed to register the extension but the description isn't being shown in explorer on xp or 7, I can not also get the icon to display. Below is the code I found on the internet: Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long Private Declare Function RegSetValue Lib "advapi32.dll" Alias "RegSetValueA" (ByVal hKey As Long, ByVal lpSubKey ...

How to create a .XLS file instead of a .CSV file
I have a COBOL program that generates a .CSV file regularly but I have a problem in the .csv file my users want the file to be in .XLS instead of .CSV is there a simple way I can turn my .csv file into a ..XLS file please advise. Can my COBOL program put some structure to turn the .CSV file into a ..XLS file. Also, can somebody share a VB Script to turn a .CSV file into a .XLS file. Thanks Karen An easy way is to open it in Excel and then save it as a workbook. You might just write a CSV file and name it with an XLS extension if the main gripe is having to change the fileopen dialog to lo...

How do I get invisible lines & borders to re-appear?
In Publisher 2003, table grid lines, text box borders and autoshape borders have become invisible on-screen, although they do print out. Any ideas on how to remedy this? Recently installed Adobe PDF Maker which seems to have precipitated this, although it could be entirely co-incidental. Try updating your video drivers. -- JoAnn Paules MVP Microsoft [Publisher] "Ackerman & Co" <Ackerman & Co@discussions.microsoft.com> wrote in message news:0FFE40C2-D6A8-43AE-89E4-061EBB6501DB@microsoft.com... > In Publisher 2003, table grid lines, text box borders and auto...

Transfer files from money 99 to money 2003
We have a new computer with money 2003, old computer has our records in money 99. We tried to import export but the records to not come across correctly. What should we d???? You shouldn't have to export or import. Just move across your .MNY data file and open it with the newer version. See http://umpmfaq.info/faqdb.php?q=68. "Michelle" <anonymous@discussions.microsoft.com> wrote in message news:1351501c419bd$2899add0$a001280a@phx.gbl... > We have a new computer with money 2003, old computer has > our records in money 99. We tried to import export but > the...

Can I open a csv file with xls extension in Excel 2002?
It works on Excel 97, 2000, but not 2002. Thanks! Does this mean you can't open it via File|Open or by double clicking on the file in windows explorer? Or something else? A little more info will get you a better response. Geoff wrote: > > It works on Excel 97, 2000, but not 2002. > > Thanks! -- Dave Peterson ec35720@msn.com ...

How do you create resouces to be used
This is a multi-part message in MIME format. ------=_NextPart_000_002F_01C4230B.97650910 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I was told that you can create resources (conference room) to be used = for scheduling. How is this done? Do you lose mailboxes? --=20 BART DANBY ------=_NextPart_000_002F_01C4230B.97650910 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META h...

import .pst file into entourage 2008 no access to pc
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel my pc just broke I have my outlook 2007 file saved in a .pst file, I don't have access to a pc, what I can do to import in entourage? <br> It seems that for mac office the compatibility is essential but not for all!!! On 4/7/10 6:53 PM, ladyelena@officeformac.com wrote: > just broke I have my outlook 2007 file saved in a .pst file, I don't > have access to a pc, what I can do to import in entourage? There are some third party option that can help with that. Check out the options on...

How do I create a chart with 6 bars for data and 1 total line
I have 6 products that I have created a bar chart for showing total units sold for 5 years. I want to add a line (just one) that shows the total units sold for the entire product category over the same time period to the same chart. I tried combination chart but it changes 1/2 the product to line and keeps 1/2 of them bars... Hi, Create a column chart for all the data and then select the series you want to plot as a line. Change the chart type for this series. Cheers Andy -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info "ddavis13" <ddavis13@discussions.mic...