Qbasicnews.com
November 27, 2021, 06:25:07 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Stupid registry...grrrrrrrrrrrr  (Read 3309 times)
adosorken
*/-\*
*****
Posts: 3655



WWW
« on: September 09, 2004, 11:21:50 PM »

Okay, here's the deal...I'm writing an uninstall application, and it's suposed to delete the values and then the keys. Well, it deletes the values just fine, but then when it comes to the keys, it has no idea what the hell to do. I'm using RegDeleteValue for deleting the values, and RegDeleteKey as the attempt to clear out the keys after the values are all gone. I have read that you can just use RegDeleteKey and it will wipe out all values, but I already tried that as well, and it didn't do squat. So...anyone got any ideas as to why the API call wouldn't work?
Logged

I'd knock on wood, but my desk is particle board.
Diroga
Been there, done that
*****
Posts: 1087


« Reply #1 on: September 10, 2004, 02:38:07 AM »

delete the key then the value?
Logged
Neo
Na_th_an
*****
Posts: 2150



« Reply #2 on: September 10, 2004, 08:18:02 AM »

Take a look: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/regdeletekey.asp

Maybe it could be this sentence...:
Quote from: "MSDN Library"
A deleted key is not removed until the last handle to it has been closed.

The subkey to be deleted must not have subkeys. To delete a key and all its subkeys, you need to recursively enumerate the subkeys and delete them individually. To recursively delete keys, use the SHDeleteKey function.

Windows Me/98/95: The function also deletes all subkeys and values. To delete a key only if the key has no subkeys or values, use the SHDeleteEmptyKey function.

I don't know if this applies to your situation since I don't know which OS you are using... :roll:
Logged
TheBigBasicQ
*/-\*
*****
Posts: 4550



WWW
« Reply #3 on: September 10, 2004, 01:56:20 PM »

Quote from: "Diroga"
delete the key then the value?


That is impossible!

ado: Which version of windows are you talking about? I recently made an application for WinXP and it has given me nightmares!
Logged
adosorken
*/-\*
*****
Posts: 3655



WWW
« Reply #4 on: September 10, 2004, 11:08:42 PM »

I'm writing the app in Win98SE but the OS is irrelevant since the function is universal across all Win32 platforms. And the last handle IS being closed...*sigh* oh well, guess I'll keep tinkering. Cheesy

You can't delete the values after the key, because the values are contained within the key. Cheesy
Logged

I'd knock on wood, but my desk is particle board.
adosorken
*/-\*
*****
Posts: 3655



WWW
« Reply #5 on: September 11, 2004, 10:46:35 AM »

Okay, figured it out...you have to alias RegDeleteKeyA for it to work...no tutorial anywhere explained that, and actually, they consistently gave the wrong prototype. Fixed now. Thanks for the help though, guys. Cheesy
Logged

I'd knock on wood, but my desk is particle board.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!