Click here to Skip to main content
15,913,027 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralPainting On Desktop Pin
Member 99352617-Jun-04 9:54
Member 99352617-Jun-04 9:54 
GeneralRe: Painting On Desktop Pin
*Dreamz17-Jun-04 18:38
*Dreamz17-Jun-04 18:38 
GeneralConverting XML strings from webservice Pin
ldaoust17-Jun-04 9:44
ldaoust17-Jun-04 9:44 
Generaldisplaying bmp image Pin
pavanbabut17-Jun-04 9:28
pavanbabut17-Jun-04 9:28 
GeneralRe: displaying bmp image Pin
microcyb17-Jun-04 10:04
microcyb17-Jun-04 10:04 
GeneralRe: displaying bmp image Pin
pavanbabut17-Jun-04 10:11
pavanbabut17-Jun-04 10:11 
GeneralRe: displaying bmp image Pin
vleungc17-Jun-04 12:24
vleungc17-Jun-04 12:24 
GeneralRegOpenKeyEx on MS Visual C++ Pin
carpetbagger17-Jun-04 9:19
carpetbagger17-Jun-04 9:19 
Hi to all in bit crunch land.
I am not very advanced with the VStudio.net platform so don't fall over hurting yourself laughing that this!
I am trying to polish off a program that will read an .ini file for its parameters and locate a registry key value based on these parameters and replace the subject key with the supplied data.

The problem I seem to have is in using a pointer to the key value in the statement: lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE, reg_key_tree, 0, KEY_QUERY_VALUE, &hKey);

reg_key_tree is defined as: char reg_key_tree[1024];

lRet returns a 2 on this branch unless I have previously opened the registry on the same machine using the desktop GUI and then it returns the 0 for ERROR_SUCCESS. Once the registry has been opened, this program always works. I have reviewed code from Microsoft and on the face of it, it should work.

If I compile the program with the reg_key_tree variable written out and surrounded in quotes, it always works regardless if the registry had been opened in any other window.

Can someone teach an old dog this new trick? Thanks in advance.

Carpetbagger
GeneralRe: RegOpenKeyEx on MS Visual C++ Pin
gamitech17-Jun-04 12:02
gamitech17-Jun-04 12:02 
GeneralRe: RegOpenKeyEx on MS Visual C++ Pin
ask_you17-Jun-04 20:47
ask_you17-Jun-04 20:47 
GeneralEnumeration Attributes Pin
Kevin Kucera17-Jun-04 9:18
sussKevin Kucera17-Jun-04 9:18 
GeneralRe: Enumeration Attributes Pin
Michael Dunn17-Jun-04 20:21
sitebuilderMichael Dunn17-Jun-04 20:21 
GeneralDisplaying a CTreeView Pin
kfaday17-Jun-04 9:10
kfaday17-Jun-04 9:10 
GeneralLoad a bitmap in a CStatic form a file Pin
kfaday17-Jun-04 9:07
kfaday17-Jun-04 9:07 
GeneralRe: Load a bitmap in a CStatic form a file Pin
ldaoust17-Jun-04 9:47
ldaoust17-Jun-04 9:47 
GeneralRe: Load a bitmap in a CStatic form a file Pin
kfaday19-Jun-04 4:39
kfaday19-Jun-04 4:39 
GeneralSockets in 64-bit Pin
s7roz17-Jun-04 8:56
s7roz17-Jun-04 8:56 
GeneralRe: Sockets in 64-bit Pin
valikac17-Jun-04 12:57
valikac17-Jun-04 12:57 
GeneralCString vs. std::string performance for large buffers Pin
Maximilien17-Jun-04 7:45
Maximilien17-Jun-04 7:45 
GeneralRe: CString vs. std::string performance for large buffers Pin
palbano17-Jun-04 8:22
palbano17-Jun-04 8:22 
Generalfollowup and another question. Pin
Maximilien17-Jun-04 10:34
Maximilien17-Jun-04 10:34 
GeneralRe: followup and another question. Pin
vladfein17-Jun-04 11:32
vladfein17-Jun-04 11:32 
GeneralDDEML - DdePostAdvise Pin
swerajan17-Jun-04 7:20
swerajan17-Jun-04 7:20 
GeneralBasic Graphics Question Pin
Piccaso17-Jun-04 6:30
Piccaso17-Jun-04 6:30 
GeneralRe: Basic Graphics Question Pin
Roger Wright17-Jun-04 6:52
professionalRoger Wright17-Jun-04 6:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.