Click here to Skip to main content
15,887,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: (20*23) + (25*28) + (30*33) + (35*38) +...........+ (m*(m-3)) what is the c programmimg code of the summetion of this series Pin
Richard MacCutchan20-Jun-23 6:19
mveRichard MacCutchan20-Jun-23 6:19 
GeneralRe: (20*23) + (25*28) + (30*33) + (35*38) +...........+ (m*(m-3)) what is the c programmimg code of the summetion of this series Pin
jschell22-Jun-23 7:58
jschell22-Jun-23 7:58 
GeneralRe: (20*23) + (25*28) + (30*33) + (35*38) +...........+ (m*(m-3)) what is the c programmimg code of the summetion of this series Pin
Richard MacCutchan22-Jun-23 9:36
mveRichard MacCutchan22-Jun-23 9:36 
GeneralRe: (20*23) + (25*28) + (30*33) + (35*38) +...........+ (m*(m-3)) what is the c programmimg code of the summetion of this series Pin
jschell23-Jun-23 10:29
jschell23-Jun-23 10:29 
QuestionRegQueryValueExW vs RegQueryValueExA Pin
PV202317-Jun-23 22:41
PV202317-Jun-23 22:41 
AnswerRe: RegQueryValueExW vs RegQueryValueExA Pin
Graham Breach18-Jun-23 1:34
Graham Breach18-Jun-23 1:34 
GeneralRe: RegQueryValueExW vs RegQueryValueExA Pin
PV202318-Jun-23 4:05
PV202318-Jun-23 4:05 
GeneralRe: RegQueryValueExW vs RegQueryValueExA Pin
Dave Kreskowiak18-Jun-23 4:42
mveDave Kreskowiak18-Jun-23 4:42 
What's so strange? The call is telling you the number of bytes needed to hold the value string that would be returned.

For an ASCII string, you need 10 bytes. For the Unicode version, you need 20 bytes. Read the documentation on RegQueryValueExA (ow W):
Quote:
A pointer to a variable that specifies the size of the buffer pointed to by the lpData parameter, in bytes. When the function returns, this variable contains the size of the data copied to lpData.

The lpcbData parameter can be NULL only if lpData is NULL.

If the data has the REG_SZ, REG_MULTI_SZ or REG_EXPAND_SZ type, this size includes any terminating null character or characters unless the data was stored without them. For more information, see Remarks.

---> If the buffer specified by lpData parameter is not large enough to hold the data, the function returns ERROR_MORE_DATA and stores the required buffer size in the variable pointed to by lpcbData. In this case, the contents of the lpData buffer are undefined. <---

If lpData is NULL, and lpcbData is non-NULL, the function returns ERROR_SUCCESS and stores the size of the data, in bytes, in the variable pointed to by lpcbData. This enables an application to determine the best way to allocate a buffer for the value's data.

If hKey specifies HKEY_PERFORMANCE_DATA and the lpData buffer is not large enough to contain all of the returned data, RegQueryValueEx returns ERROR_MORE_DATA and the value returned through the lpcbData parameter is undefined. This is because the size of the performance data can change from one call to the next. In this case, you must increase the buffer size and call RegQueryValueEx again passing the updated buffer size in the lpcbData parameter. Repeat this until the function succeeds. You need to maintain a separate variable to keep track of the buffer size, because the value returned by lpcbData is unpredictable.

If the lpValueName registry value does not exist, RegQueryValueEx returns ERROR_FILE_NOT_FOUND and the value returned through the lpcbData parameter is undefined.


Questionmutex problem Pin
PV202314-Jun-23 20:51
PV202314-Jun-23 20:51 
AnswerRe: mutex problem Pin
Richard MacCutchan14-Jun-23 21:17
mveRichard MacCutchan14-Jun-23 21:17 
AnswerRe: mutex problem Pin
jschell15-Jun-23 2:33
jschell15-Jun-23 2:33 
QuestionIs there a way to add all the elements of a vector to an integer sequentially? Pin
puckettrobinson6755-Jun-23 18:16
puckettrobinson6755-Jun-23 18:16 
AnswerRe: Is there a way to add all the elements of a vector to an integer sequentially? Pin
Victor Nijegorodov5-Jun-23 20:39
Victor Nijegorodov5-Jun-23 20:39 
AnswerRe: Is there a way to add all the elements of a vector to an integer sequentially? Pin
Richard MacCutchan5-Jun-23 21:30
mveRichard MacCutchan5-Jun-23 21:30 
AnswerRe: Is there a way to add all the elements of a vector to an integer sequentially? Pin
CPallini5-Jun-23 21:44
mveCPallini5-Jun-23 21:44 
QuestionImage compression Pin
Calin Negru30-May-23 9:09
Calin Negru30-May-23 9:09 
AnswerRe: Image compression Pin
OriginalGriff30-May-23 9:18
mveOriginalGriff30-May-23 9:18 
GeneralRe: Image compression Pin
Calin Negru30-May-23 23:52
Calin Negru30-May-23 23:52 
QuestionCom Automation latest library for working with ms excel. Pin
I_am_nayak22-May-23 18:34
I_am_nayak22-May-23 18:34 
AnswerRe: Com Automation latest library for working with ms excel. Pin
_Flaviu22-May-23 20:28
_Flaviu22-May-23 20:28 
AnswerRe: Com Automation latest library for working with ms excel. Pin
Victor Nijegorodov22-May-23 22:47
Victor Nijegorodov22-May-23 22:47 
QuestionCPU Usage Pin
Richard Andrew x6419-May-23 15:56
professionalRichard Andrew x6419-May-23 15:56 
AnswerRe: CPU Usage Pin
Dave Kreskowiak19-May-23 17:48
mveDave Kreskowiak19-May-23 17:48 
GeneralRe: CPU Usage Pin
harold aptroot19-May-23 18:53
harold aptroot19-May-23 18:53 
AnswerRe: CPU Usage Pin
Greg Utas20-May-23 0:13
professionalGreg Utas20-May-23 0:13 

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.