Solved

Visual C++ Access violation reading location 0x00000004

Posted on 2010-08-14
3
1,772 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

932 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now