I actually rewrote that vector type. Here's the new thing, and sorry I forgot to post the variable def's.
Code:
structLink templink;
CEdit* pGetEdit[512];
for(i=0; i<FAD.nExpected; i++)
{
pGetEdit[i] = (CEdit*) GetDlgItem(i+100);
int len = pGetEdit[i]->LineLength();
pGetEdit[i]->GetLine(1,templink.ParamName.GetBuffer(len), len);
templink.Index = i;
if(len != 0)
vars.vectParmSelected.push_back(templink);
}
where
Code:
struct structLink
{
CString ParamName;
int Index;
};
class gVars
{
public:
std::vector < structBafParam > vectBP;
std::vector <structLink> vectParmSelected;
char hEngName[13];
..............
It only fails if len ever has a vlue of 0.