Click here to Skip to main content
15,896,063 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Office 2010 style in Windows Ribbon Framework? Pin
Alain Rist4-Oct-10 20:32
Alain Rist4-Oct-10 20:32 
QuestionRegGetValue / Win32 Pin
Fareed Rizkalla3-Oct-10 1:09
Fareed Rizkalla3-Oct-10 1:09 
AnswerRe: RegGetValue / Win32 Pin
Richard MacCutchan3-Oct-10 1:43
mveRichard MacCutchan3-Oct-10 1:43 
AnswerRe: RegGetValue / Win32 Pin
Jonathan Davies3-Oct-10 1:48
Jonathan Davies3-Oct-10 1:48 
GeneralRe: RegGetValue / Win32 Pin
Fareed Rizkalla3-Oct-10 3:21
Fareed Rizkalla3-Oct-10 3:21 
GeneralRe: RegGetValue / Win32 Pin
«_Superman_»3-Oct-10 3:57
professional«_Superman_»3-Oct-10 3:57 
GeneralRe: RegGetValue / Win32 Pin
Richard MacCutchan3-Oct-10 4:01
mveRichard MacCutchan3-Oct-10 4:01 
QuestionSafeArrayCreate throwing ACCESS_VIOLATION exception, why? Pin
NeerajMD1-Oct-10 21:58
NeerajMD1-Oct-10 21:58 
I'm trying to create a SafeArray of Variants (min 1000 and max 6000 elements). Initially the array is not going to contain the variants, they will be added later on. Here's the sample code -

<code>

SAFEARRAY *psfaResult = NULL;
SAFEARRAYBOUND rgsabound[1];
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = ElementCount;

psfaResult = SafeArrayCreate(VT_VARIANT, 1, rgsabound);

if(psfaResult == NULL)
{
/*
error handling
*/
}

</code>

What happens is, frequently an access violaion exception is thrown during the creation causing the code to crash. I have a snapshot of the callstack when this problem occurs, but I guess I'll have to type it out -

First chance exception 0xC0000005 ACCESS_VIOLATION occurred at 0x7C911689, read of address 0x00000000 at 0x7C911689 (in C:\WINDOWS\system32\ntdll.dll)

0x7C911689 RtlInitializeCriticalSection + Ox6C in C:\WINDOWS\system32\ntdll.dll

0x7C91A3F5 RtlReAllocateHeap + Ox855 in C:\WINDOWS\system32\ntdll.dll

0x7C911937 RtlInitializeCriticalSection + Ox31A in C:\WINDOWS\system32\ntdll.dll

0x774FD03B IsValidIid + OxFA in C:\WINDOWS\system32\ole32.dll

0x7712AA1B SafeArrayAllocData + Ox3B in C:\WINDOWS\system32\oleaut32.dll

0x7712AAE3 SafeArrayCreate + Ox8E in C:\WINDOWS\system32\oleaut32.dll

I have attempted an alternative of using CComSafeArray as well, which internally uses the same route, hence in vain. The issue occurs only in release mode, 5/10 times.

My feeling is that this is an effect and the cause is elsewhere in the code. However, what I am looking out for is, directions to search the probable causes.

Any insight into the problem will be helpful! Thanks!
AnswerRe: SafeArrayCreate throwing ACCESS_VIOLATION exception, why? Pin
Niklas L1-Oct-10 22:24
Niklas L1-Oct-10 22:24 
GeneralRe: SafeArrayCreate throwing ACCESS_VIOLATION exception, why? Pin
NeerajMD2-Oct-10 0:11
NeerajMD2-Oct-10 0:11 
QuestionWeird threading error with LibTiff Pin
Alan Balkany1-Oct-10 5:06
Alan Balkany1-Oct-10 5:06 
AnswerRe: Weird threading error with LibTiff PinPopular
Blake Miller1-Oct-10 6:14
Blake Miller1-Oct-10 6:14 
GeneralRe: Weird threading error with LibTiff Pin
Alan Balkany1-Oct-10 6:23
Alan Balkany1-Oct-10 6:23 
QuestionXP theme/common control question Pin
David Crow1-Oct-10 4:29
David Crow1-Oct-10 4:29 
AnswerRe: XP theme/common control question Pin
Richard MacCutchan1-Oct-10 5:53
mveRichard MacCutchan1-Oct-10 5:53 
QuestionHow to question about stepping into a dll Pin
ns1-Oct-10 4:28
ns1-Oct-10 4:28 
AnswerRe: How to question about stepping into a dll Pin
Richard MacCutchan1-Oct-10 5:37
mveRichard MacCutchan1-Oct-10 5:37 
GeneralRe: How to question about stepping into a dll Pin
Blake Miller1-Oct-10 6:16
Blake Miller1-Oct-10 6:16 
GeneralRe: How to question about stepping into a dll Pin
Richard MacCutchan1-Oct-10 10:16
mveRichard MacCutchan1-Oct-10 10:16 
AnswerRe: How to question about stepping into a dll Pin
Alan Balkany1-Oct-10 6:27
Alan Balkany1-Oct-10 6:27 
QuestionC2061 Compiler Error syntax error : identifier 'BOOL' Pin
timb7530-Sep-10 22:29
timb7530-Sep-10 22:29 
AnswerRe: C2061 Compiler Error syntax error : identifier 'BOOL' Pin
CPallini30-Sep-10 22:59
mveCPallini30-Sep-10 22:59 
GeneralRe: C2061 Compiler Error syntax error : identifier 'BOOL' Pin
Sauro Viti30-Sep-10 23:48
professionalSauro Viti30-Sep-10 23:48 
GeneralRe: C2061 Compiler Error syntax error : identifier 'BOOL' Pin
CPallini1-Oct-10 2:23
mveCPallini1-Oct-10 2:23 
JokeRe: C2061 Compiler Error syntax error : identifier 'BOOL' Pin
bleedingfingers1-Oct-10 2:26
bleedingfingers1-Oct-10 2: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.