Run-Time Check Failure #2 - Stack around the variable was corrupted.
I have problem during execution of my program.
Error is Run-Time Check Failure #2 - Stack around the variable 'pwADErrBuff' was corrupted.
I increased variable pwADErrBuff size from 256 to 2048. But, still have problem.
SAFE_APPEND(maxAlloc, pwErrBuff, L"<Unable to retrieve ADs Error>");
SAFE_APPEND(maxAlloc, pwErrBuff, pwADErrBuff);
SAFE_APPEND(maxAlloc, pwErrBuff, L"\n");
SAFE_APPEND(maxAlloc, pwErrBuff, L"<*> System Error: <*> \n");
// Check the standard system to crack the bad HRESULT into a string
if (!FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, 0, passedhr, 0, sz, 1024, 0))
wcscat(sz, L"Unknown HRESULT error");
SAFE_APPEND(maxAlloc, pwErrBuff, sz);
wprintf(L"\nERROR on %s\n\n",pwReason);
printf("\nERROR on %X\n\n",passedhr);
Re: Run-Time Check Failure #2 - Stack around the variable was corrupted.
1) Please use code tags..go back and RE-READ the "BEfore you post" announcement if you have forgotten how.
2) The code does NOT look like (but it is hard to read without code tags!) C++/CLI [aka .NET] code. If it is NOT, then this is the WRONG forum, and need to ask a moderator to MOVE your thread (do NOT crate a duplicate, it simply creates more work for the moderator, who is already VOLUNTEERING (like the rest of us) his valuable time.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009 In theory, there is no difference between theory and paractice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first