Hey,
I want to fill a vector usign the following code:
aside from the visual part, the coe fails at run-time saying that the memory could not be read if I have the if statement. If I remove the if statement and copy every entry without checking into the vector it works fine. len represents the length of a line copied into str. So if there is nothign there len=0 and I don't want to copy it into the vector.Code:for(i=0; i<FAD.nExpected; i++) { pGetEdit[i] = (CEdit*) GetDlgItem(i+100); int len = pGetEdit[i]->LineLength(); pGetEdit[i]->GetLine(1,str.GetBuffer(len), len); if(len != 0) vars.vectParmSelected.push_back(str); }
Is there another way to do it? or what am I doing wrong?



LinkBack URL
About LinkBacks


