LITTLEBLACKDOG.COM Forum Index LITTLEBLACKDOG.COM

 
LWD LWD   FAQ FAQ   Memberlist Memberlist   Usergroups Usergroups   Active Topics Active Topics   Register Register  
  Profile Profile   Log in to check your private messages Log in to check your private messages   Log in Log in  
  Who is Online Who is Online   Image Gallery Image Gallery   Chat Chat   Search Search  
  LWDGear       LBDGear  

View next topic
View previous topic
Post new topic     Reply to topic   LITTLEBLACKDOG.COM Forum Index » Code Warriors
Author Message
Lycander
Lead Dog
Lead Dog


Joined: 24 May 2002
Age: 25
Posts: 12196
Location: The Constitution State

Post Posted: Tue Apr 08, 2003 11:14 am   Post subject: Windows Reg keys Reply with quote Back to top  

I was about to put this in the Rant forum but I figure I might get better responses here.

I'm writing this program in C++/MFC, but use regular Win32 API calls to get at the registry keys. I navigate my way to the CEAPPMGR.EXE key and it only has one entry, "(Default)".

So I go:
Code: Select all

if(RegQueryValueEx(hkCS,"(Default)",0,&dwType,appMgr,&dwSize) != ERROR_SUCCESS)
      MessageBox("Failed to query CEAppMgr.exe","",MB_OK);


And the message box pops up telling me it failed to query the value in that key. This value I'm trying to get is the one and only, and all the other keys have at least one "(Default)" entry in them although I haven't tried getting at those from other keys yet.

Anyone know something I don't?

apMgr is a BYTE* I initialize:
Code: Select all

appMgr = (BYTE*)LocalAlloc(LPTR, 100);


So it's a buffer that's 100 bytes long. Should be enough to hold the path and filename of CEAPPMGR.EXE stored in this reg key.

_________________
To the top of hunger mountain
I found my solitary ways
Where I could live on nuts and honey
And take my shelter in a cave
View user's profile Send private message
Lycander
Lead Dog
Lead Dog


Joined: 24 May 2002
Age: 25
Posts: 12196
Location: The Constitution State

Post Posted: Tue Apr 08, 2003 11:59 am   Post subject: Reply with quote Back to top  

Never mind, this really does belong in the Rant forum.

Apparently all I have to do is pass NULL instead of specifying that I want the "(Default)" value. Stupid Microsoft, they could have told me that in the docs so I didn't have to run around like an idiot trying to find the answer. I should have just went with instinct on this one.

*Lets out a stream of obscenities in the general direction of Redmond*

_________________
To the top of hunger mountain
I found my solitary ways
Where I could live on nuts and honey
And take my shelter in a cave
View user's profile Send private message
tecgod13
Tail-Wagger
Tail-Wagger


Joined: 13 Aug 2002
Posts: 2853
Location: Western Massachusetts

Post Posted: Tue Apr 08, 2003 2:28 pm   Post subject: Reply with quote Back to top  

Lycander wrote:
*Lets out a stream of obscenities in the general direction of Redmond*

Rofl

Can I join in too? Twisted Evil

_________________
"The problem with America is stupidity. I'm not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself?"
http://www.livejournal.com/users/tecgod13/
View user's profile Send private message Send e-mail
Lycander
Lead Dog
Lead Dog


Joined: 24 May 2002
Age: 25
Posts: 12196
Location: The Constitution State

Post Posted: Tue Apr 08, 2003 3:03 pm   Post subject: Reply with quote Back to top  

*Gives you a beer*

Sure, come join me. The beer helps with the profanity.

_________________
To the top of hunger mountain
I found my solitary ways
Where I could live on nuts and honey
And take my shelter in a cave
View user's profile Send private message
tecgod13
Tail-Wagger
Tail-Wagger


Joined: 13 Aug 2002
Posts: 2853
Location: Western Massachusetts

Post Posted: Tue Apr 08, 2003 3:20 pm   Post subject: Reply with quote Back to top  

mmmm beer...

Oh don't even get me started on profanity while drunk. One of my least favorite rules while playing asshole was the swearing rule. That would get me more drunk, then more swearing, then more drunk, then I'm no good at playing and end up asshole, and more swearing.. ... you get the picture... Big Smile

Not to mention what I'd like to say about Win2K now that it crashes everytime I try installing it... grrrr

*goes to get more beer, or liquor, or both* Laughing

_________________
"The problem with America is stupidity. I'm not saying there should be a capital punishment for stupidity, but why don't we just take the safety labels off of everything and let the problem solve itself?"
http://www.livejournal.com/users/tecgod13/
View user's profile Send private message Send e-mail
Lycander
Lead Dog
Lead Dog


Joined: 24 May 2002
Age: 25
Posts: 12196
Location: The Constitution State

Post Posted: Fri Apr 11, 2003 7:51 am   Post subject: Reply with quote Back to top  

I just got started with the profanity towards installing RH Linux. Only one time in my life was I able to install and boot that distro. Grr... I'm doing a Gentoo now - left my machine back home compiling. You'd think that this kind of install would really get me cursing, but no it's actually going pretty well. Well to be honest, at the part where I had to use Vi to edit text files, I had to take myself outside so I wouldn't hurt myself or my computer. I kept getting stuck in "ex" insert mode, and every piece of doc I read says to press ESC to get out of it. That's what I did and I'm still stuck!

Fixed it by making the conf file in Windows and putting it on a floppy and copy/replace the old conf file with that. And that worked so I was able to move on.

Further down in the install guide they tell me "Oh yeah, by the way, use nano to edit the conf files."

F******CK!!!!!! Damn you Gentoo!!! This sort of info would have be useful 2 hours ago! Hehe. I mean I know how to use Vim, but plain ol' Vi was acting weird on me.

_________________
To the top of hunger mountain
I found my solitary ways
Where I could live on nuts and honey
And take my shelter in a cave
View user's profile Send private message
csign
Moderator
Moderator


Joined: 26 May 2001
Posts: 8155
Location: Borneo

Post Posted: Fri Apr 11, 2003 3:19 pm   Post subject: Reply with quote Back to top  

install mc or one of the nicer editors(nano seems to be named often). But seeing that every editor execpt cat is nicer than vi i could also say install a different editor
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic     Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
phpBB SEO
All times are GMT - 8 Hours

Help us keep advertisements off this site. Donate today!