Solved

Visual C++ Access violation reading location 0x00000004

Posted on 2010-08-14
3
1,838 Views
Last Modified: 2012-05-10
Well...i've converted to bstr 10 different ways and still get this error.

Unhandled exception at 0x00f61ce0 (FEPAdapterWrapperCPP2.dll) in ceraexe0471.exe: 0xC0000005: Access violation reading location 0x00000004.

I’m sure it just has to do with the way I’m referring to a variable…. Here is the code causing the error.

Last line is where the error occurs……. pstrInputClaim is passed into this function as a char[]

                  CComBSTR bstr(pstrInputClaim);
                  BSTR bstrInputClaim = bstr.Copy();    
                  vResult = plDomDocument->loadXML(bstrInputClaim,&bSuccess);

thanks for your continued support : )
0
Comment
Question by:fraeliz8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 33

Accepted Solution

by:
pgnatyuk earned 250 total points
ID: 33437762
An example from Microsoft is here:
http://msdn.microsoft.com/en-us/library/dd893387(VS.85).aspx

they simply use CComBSTR.

I think, in your case

CComBSTR bstr(pstrInputClaim);
hr = pXMLDoc->loadXML(bstr, & bSuccess);

will work.

I didn't forget about CoInitialize
0
 

Author Comment

by:fraeliz8
ID: 33437954
Thanks.... turns out the bstr conversion was not the problem..but that example you provided from MSDN helped my find the problem...it was with the pXMLDoc....not being valid.... all is good for now..thanks so much.
0
 
LVL 33

Expert Comment

by:pgnatyuk
ID: 33437985
You are welcome. I'm glad to help.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question