Click here to Skip to main content
15,891,184 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow does CListCtrl manage its scrollbars? Pin
Michael Carruth27-Jun-01 10:43
Michael Carruth27-Jun-01 10:43 
AnswerRe: How does CListCtrl manage its scrollbars? Pin
27-Jun-01 17:23
suss27-Jun-01 17:23 
QuestionHow to enable/disable a menu item in the system tray Pin
Anubha Khurana27-Jun-01 10:14
Anubha Khurana27-Jun-01 10:14 
AnswerRe: How to enable/disable a menu item in the system tray Pin
Bret Faller27-Jun-01 12:36
Bret Faller27-Jun-01 12:36 
GeneralRe: How to enable/disable a menu item in the system tray Pin
Anubha Khurana27-Jun-01 14:08
Anubha Khurana27-Jun-01 14:08 
QuestionHow to upload a file to a php file that normally handle a html form ?? Pin
27-Jun-01 9:11
suss27-Jun-01 9:11 
AnswerRe: How to upload a file to a php file that normally handle a html form ?? Pin
Tomasz Sowinski27-Jun-01 9:40
Tomasz Sowinski27-Jun-01 9:40 
GeneralMy registry won't register Pin
Joe Moldovan27-Jun-01 9:03
Joe Moldovan27-Jun-01 9:03 
Perhaps some kind soul out there can see what I'm doing wrong here:

The following code tries to get some registry values.

UCHAR ServerIP[ 16 ], ServerToPort[ 16 ], ServerFromPort[ 16 ];
UCHAR LocalIP[ 16 ], LocalToPort[ 16 ], LocalFromPort[ 16 ];
HKEY key1, key2;
DWORD disp, type, size;
LONG result;

// Open the company key
result = RegCreateKeyEx( HKEY_CURRENT_USER, "UHS", 0, "", REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS, NULL, &key1, &disp );
// Open the Local subkey
result = RegCreateKeyEx( key1, "Local", 0, "", REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS, NULL, &key2, &disp );

// Get the values of IP, InPort, OutPort
result = RegQueryValueEx( key2, "IP", 0, &type, LocalIP, &size );
+ result = RegQueryValueEx( key2, "ToPort", 0, &type, LocalToPort, &size );
+ result = RegQueryValueEx( key2, "FromPort", 0, &type, LocalFromPort, &size );

// Open the Server subkey
result = RegCreateKeyEx( key1, "Server", 0, "", REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS, NULL, &key2, &disp );

// Get the values of IP, InPort, OutPort
? result = RegQueryValueEx( key2, "IP", 0, &type, ServerIP, &size );
result = RegQueryValueEx( key2, "ToPort", 0, &type, ServerToPort, &size );
result = RegQueryValueEx( key2, "FromPort", 0, &type, ServerFromPort, &size );

The registry entries are just IPs and port numbers and the editor shows they are OK. When the above code is run it fills in everything EXCEPT ServerIP. This call returns an error "234" which the ISDN helpfully identifies as "More data available". If I leave out the two calls marked with "+" the thing works and I get the ServerIP.

I have tried to change the order of calling things but no matter what I do, one of the values returns an error. I have tried all kinds of other things like having individual key handles, flushing etc. but nothing works.

My registry is not corrupt and I have tried this on two different machines in different offices. Hope someone knows what's happening.

GeneralRe: My registry won't register Pin
Tomasz Sowinski27-Jun-01 9:34
Tomasz Sowinski27-Jun-01 9:34 
GeneralRe: My registry won't register Pin
Joe Moldovan27-Jun-01 12:49
Joe Moldovan27-Jun-01 12:49 
GeneralNew User C++ help Pin
Rob Frymire27-Jun-01 8:58
Rob Frymire27-Jun-01 8:58 
GeneralRe: New User C++ help Pin
Tomasz Sowinski27-Jun-01 9:45
Tomasz Sowinski27-Jun-01 9:45 
GeneralDynamically allocate an array of an array Pin
Zach27-Jun-01 7:16
Zach27-Jun-01 7:16 
GeneralRe: Dynamically allocate an array of an array Pin
Frank Liao27-Jun-01 7:57
Frank Liao27-Jun-01 7:57 
GeneralRe: Dynamically allocate an array of an array Pin
Zach27-Jun-01 8:47
Zach27-Jun-01 8:47 
GeneralRe: Dynamically allocate an array of an array Pin
Frank Liao27-Jun-01 9:26
Frank Liao27-Jun-01 9:26 
GeneralRe: Dynamically allocate an array of an array Pin
Zach27-Jun-01 17:06
Zach27-Jun-01 17:06 
GeneralWindows service basics (start, install...) Pin
Joan M27-Jun-01 6:33
professionalJoan M27-Jun-01 6:33 
GeneralRe: Windows service basics (start, install...) Pin
Anders Molin27-Jun-01 10:18
professionalAnders Molin27-Jun-01 10:18 
GeneralRe: Windows service basics (start, install...) Pin
Tim Deveaux27-Jun-01 10:21
Tim Deveaux27-Jun-01 10:21 
GeneralAnother Conversion Question Pin
John Uhlenbrock27-Jun-01 6:32
John Uhlenbrock27-Jun-01 6:32 
GeneralRe: Another Conversion Question Pin
Tomasz Sowinski27-Jun-01 9:27
Tomasz Sowinski27-Jun-01 9:27 
GeneralRe: Another Conversion Question Pin
John Uhlenbrock27-Jun-01 10:15
John Uhlenbrock27-Jun-01 10:15 
GeneralRe: Another Conversion Question Pin
Tomasz Sowinski27-Jun-01 10:19
Tomasz Sowinski27-Jun-01 10:19 
GeneralImageList icons not showing up in color Pin
Jack Mott27-Jun-01 6:26
Jack Mott27-Jun-01 6:26 

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.