Click here to Skip to main content
15,867,568 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Detecting Windows SDK version using macros Pin
Randor 9-Apr-09 1:12
professional Randor 9-Apr-09 1:12 
GeneralRe: Detecting Windows SDK version using macros Pin
tareqsiraj9-Apr-09 7:35
tareqsiraj9-Apr-09 7:35 
QuestionNew Thread and WM_QUIT Pin
TheScientistIsDead8-Apr-09 7:00
TheScientistIsDead8-Apr-09 7:00 
AnswerRe: New Thread and WM_QUIT Pin
Stuart Dootson8-Apr-09 8:29
professionalStuart Dootson8-Apr-09 8:29 
GeneralRe: New Thread and WM_QUIT Pin
TheScientistIsDead8-Apr-09 16:44
TheScientistIsDead8-Apr-09 16:44 
GeneralRe: New Thread and WM_QUIT Pin
Stuart Dootson8-Apr-09 20:10
professionalStuart Dootson8-Apr-09 20:10 
AnswerRe: New Thread and WM_QUIT Pin
Roger Stoltz8-Apr-09 21:31
Roger Stoltz8-Apr-09 21:31 
QuestionSetting REG_MULTI_SZ value Pin
csrss8-Apr-09 5:17
csrss8-Apr-09 5:17 
Hello. I am trying to set a REG_MULTI_SZ value. I got 2 values which should be sat. Here is my code:
DWORD dwSize = ((strlen(valueA) + strlen(valueB)) + 3);
PBYTE fValue = (BYTE *)malloc(dwSize * sizeof(DWORD));
memset(fValue , 0, dwSize);
memcpy(fValue , valueA, strlen(valueA) + 1);
memcpy(fValue + strlen(valueA) + 1, valueB, strlen(valueB) + 1);
RegSetValueEx(hk, TEXT("SomeKey"), 0, REG_MULTI_SZ, (LPBYTE) fValue ,(DWORD) dwSize);
<pre>

This code works perfect on windows xp, but crashes on Vista. Actually, it crashes each third time i run my app, but what for sure, it does not set my value at all. (It sets value and returns STATUS_SUCCESS only in one case - if i run my app in context of visual studio debugger - after compilation, i click -> Debug-> Start Debugging). Now, after it's crash i click debug and it points me to malloc.c, at this part:
<pre>
void * __cdecl _malloc_base (size_t size){
    void *res = NULL;

    //  validate size
    if (size <= _HEAP_MAXREQ) {
        for ( ;; ) {

        //  allocate memory block
            res = _heap_alloc(size); // <-- here

Exactly the same scenario, like above, appears with usage of RtlAllocateHeap:
PBYTE fValue = (BYTE *)RtlAllocateHeap(NtGetProcessHeap(),HEAP_ZERO_MEMORY,dwSize * sizeof(DWORD));

And my question is, does anyone know why or ever encountered such issue? Thanks in advance.
QuestionRe: Setting REG_MULTI_SZ value Pin
CPallini8-Apr-09 7:30
mveCPallini8-Apr-09 7:30 
AnswerRe: Setting REG_MULTI_SZ value Pin
csrss8-Apr-09 8:06
csrss8-Apr-09 8:06 
GeneralRe: Setting REG_MULTI_SZ value Pin
CPallini8-Apr-09 10:14
mveCPallini8-Apr-09 10:14 
Questiona managed array cannot have this element type Pin
Member 20210228-Apr-09 3:55
Member 20210228-Apr-09 3:55 
AnswerRe: a managed array cannot have this element type Pin
Cedric Moonen8-Apr-09 4:03
Cedric Moonen8-Apr-09 4:03 
AnswerAsked and answered 2 weeks ago Pin
led mike8-Apr-09 4:23
led mike8-Apr-09 4:23 
QuestionTripleDES ECB in Visual C++ Pin
annese8-Apr-09 2:55
annese8-Apr-09 2:55 
AnswerRe: TripleDES ECB in Visual C++ Pin
Chris Losinger8-Apr-09 6:34
professionalChris Losinger8-Apr-09 6:34 
Questionborder of the childframe Pin
prithaa8-Apr-09 2:36
prithaa8-Apr-09 2:36 
AnswerRe: border of the childframe Pin
Code-o-mat8-Apr-09 2:52
Code-o-mat8-Apr-09 2:52 
GeneralRe: border of the childframe Pin
prithaa8-Apr-09 3:09
prithaa8-Apr-09 3:09 
QuestionHelp with how to add/mix RGBA values Pin
spiffen8-Apr-09 1:17
spiffen8-Apr-09 1:17 
AnswerRe: Help with how to add/mix RGBA values Pin
Iain Clarke, Warrior Programmer8-Apr-09 1:24
Iain Clarke, Warrior Programmer8-Apr-09 1:24 
GeneralRe: Help with how to add/mix RGBA values Pin
spiffen8-Apr-09 2:22
spiffen8-Apr-09 2:22 
GeneralRe: Help with how to add/mix RGBA values Pin
Iain Clarke, Warrior Programmer8-Apr-09 2:32
Iain Clarke, Warrior Programmer8-Apr-09 2:32 
GeneralRe: Help with how to add/mix RGBA values Pin
spiffen8-Apr-09 4:16
spiffen8-Apr-09 4:16 
GeneralRe: Help with how to add/mix RGBA values Pin
Iain Clarke, Warrior Programmer8-Apr-09 6:00
Iain Clarke, Warrior Programmer8-Apr-09 6:00 

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.