Re: Access Violation Problem
- From: "John Carson" <jcarson_n_o_sp_am_@xxxxxxxxxxxxxxx>
- Date: Tue, 14 Feb 2006 00:30:03 +1100
"dramesh" <rdeekonda@xxxxxxxxxxx> wrote in message
news:1139807814.590988.188990@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Yes szValue is null terminated
In a single threaded application, I can't see how a mere assignment to a
CString of a null-terminated string could cause an access violation (if you
run out of memory, then this could indirectly cause an access violation,
depending on how your program responds to this condition). My suspicion
would be that there is a problem elsewhere in your code and the problem only
appears to be caused by the assignment.
In a multi-threaded application, an attempt by two threads to make an
assignment simultaneously could cause an access violation (e.g., two threads
could each call delete [] on the same pointer). Your code certainly needs to
guard against simultaneous assignment if that is a possibility. However, I
still think it is more likely that your problem results from a problem
elsewhere in your code (e.g., failing to allocate enough memory to store
something or reading past the end of a string or array).
--
John Carson
.
- References:
- Access Violation Problem
- From: dramesh
- Re: Access Violation Problem
- From: John Carson
- Re: Access Violation Problem
- From: dramesh
- Access Violation Problem
- Prev by Date: Re: ValidateRect/InvalidateRect-Used
- Next by Date: Re: dialogs in vc++ 8 express
- Previous by thread: Re: Access Violation Problem
- Next by thread: c++ tutorials and lessons
- Index(es):
Relevant Pages
|