Click here to Skip to main content
16,005,149 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to replace scrollbar? Pin
zuken2120-May-03 21:01
zuken2120-May-03 21:01 
AnswerRe: How to replace scrollbar? Pin
zuken2122-May-03 23:16
zuken2122-May-03 23:16 
Generalsetting fonts and color Pin
r i s h a b h s20-May-03 18:06
r i s h a b h s20-May-03 18:06 
GeneralRe: setting fonts and color Pin
Joseph Dempsey21-May-03 1:23
Joseph Dempsey21-May-03 1:23 
GeneralBurn CD Data Pin
ColinDavies20-May-03 15:58
ColinDavies20-May-03 15:58 
GeneralRe: Burn CD Data Pin
J. Dunlap20-May-03 18:54
J. Dunlap20-May-03 18:54 
GeneralRe: Burn CD Data Pin
Joerg Wiedenmann20-May-03 20:14
Joerg Wiedenmann20-May-03 20:14 
GeneralAppending text to an edit control (mem errors) Pin
stf20-May-03 11:08
stf20-May-03 11:08 
I'm trying to grab text that is already in a multi-line edit control, append more text to it and then reset the edit control to the new text. Unfortunately I'm getting memory errors after one or two times of performing this process.

Here is the code I'm using:

int cTxtLen = GetWindowTextLength(hwndEdit);
pszMem = (LPTSTR) GlobalAlloc(GPTR, cTxtLen + 1);
GetWindowText(hwndEdit,(LPWSTR)pszMem,cTxtLen + 1);
List = pszMem;
GlobalFree(pszMem);
// run List through a function that appends more text
SendMessage (hwndEdit, WM_SETTEXT, 0, (LPARAM) List.GetBuffer(0)) ;
List.ReleaseBuffer();

Anyone see what might be causing these errors?

Thanks,
stf
GeneralRe: Appending text to an edit control (mem errors) Pin
Neville Franks20-May-03 12:10
Neville Franks20-May-03 12:10 
GeneralRe: Appending text to an edit control (mem errors) Pin
John R. Shaw20-May-03 13:44
John R. Shaw20-May-03 13:44 
GeneralRe: Appending text to an edit control (mem errors) Pin
dabs22-May-03 1:12
dabs22-May-03 1:12 
GeneralRe: Appending text to an edit control (mem errors) Pin
stf22-May-03 17:54
stf22-May-03 17:54 
GeneralEnumerating DCs using ADSI Pin
Lhenno Ferrari20-May-03 11:03
Lhenno Ferrari20-May-03 11:03 
GeneralCComboBox on a CToolBar Pin
Chris Losinger20-May-03 10:40
professionalChris Losinger20-May-03 10:40 
GeneralRe: CComboBox on a CToolBar Pin
Chris Richardson20-May-03 11:02
Chris Richardson20-May-03 11:02 
GeneralRe: CComboBox on a CToolBar Pin
Anonymous20-May-03 20:58
Anonymous20-May-03 20:58 
GeneralStart VPN connection programmatically Pin
trevorb20-May-03 7:53
trevorb20-May-03 7:53 
GeneralRe: Start VPN connection programmatically Pin
Daniel Turini20-May-03 8:46
Daniel Turini20-May-03 8:46 
GeneralRe: Start VPN connection programmatically Pin
Joaquín M López Muñoz20-May-03 11:37
Joaquín M López Muñoz20-May-03 11:37 
GeneralRe: Start VPN connection programmatically Pin
Daniel Turini20-May-03 12:18
Daniel Turini20-May-03 12:18 
GeneralArrays and Memory Usage Pin
73Zeppelin20-May-03 7:00
73Zeppelin20-May-03 7:00 
GeneralRe: Arrays and Memory Usage Pin
valikac20-May-03 8:37
valikac20-May-03 8:37 
GeneralRe: Arrays and Memory Usage Pin
peterchen20-May-03 13:26
peterchen20-May-03 13:26 
GeneralRe: Arrays and Memory Usage Pin
73Zeppelin20-May-03 14:00
73Zeppelin20-May-03 14:00 
GeneralRe: Arrays and Memory Usage Pin
yaname20-May-03 16:03
yaname20-May-03 16:03 

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.