Re: First-chance exception 0xC0000005 Access violation by saving procedure
- From: "Peter Schottland" <anonymous@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 1 Aug 2007 08:27:56 +0200
CharsCount = GetWindowTextLength(hWndMainEditBox);....
lpStringInEdit = (LPTSTR)HeapAlloc(GetProcessHeap(), 0,
CharsCount); //allocates memory for buffer
It looks like your allocated buffer is too small. The returned window text
length is the number of characters. In this special case: number of
WCHAR-characters! So you have to allocate (CharCount * sizeof(WCHAR)), or
better: (CharCount * sizeof(TCHAR)).
-peter
.
- Follow-Ups:
- Prev by Date: Re: ActiveSync woes...
- Next by Date: User authentication as in ftp server
- Previous by thread: ActiveSync woes...
- Next by thread: Re: First-chance exception 0xC0000005 Access violation by saving procedure
- Index(es):