Hey,
I've just started with VC++ and I'm trying to make a GUI to let the user enter a nist of items into a bunch of edit boxes, then take the entries and store them in an array. I've read the MSDN for the functions and that's what I came up with:
It works fine if all the edit boxes are filled, but if one is left empty I get a run-time errorr saying that the memory could not be read. I jsut want it to skip that box and go on to the next one. What am I missing?
Thanks
I've just started with VC++ and I'm trying to make a GUI to let the user enter a nist of items into a bunch of edit boxes, then take the entries and store them in an array. I've read the MSDN for the functions and that's what I came up with:
Code:
structLink templink;
CEdit* pGetEdit[512];
for(i=0; i<FAD.nExpected; i++)
{
pGetEdit[i] = (CEdit*) GetDlgItem(i+100);
int len = pGetEdit[i]->LineLength();
if(len > 0)
{
pGetEdit[i]->GetLine(1,templink.ParamName.GetBuffer(len), len);
templink.Index = i;
vars.vectParmSelected.push_back(templink);
}
}
Thanks