You must be sure of the ids you are using.

The resource editor use IDs string. These strings are mapped to numbers in the resource.h.
So the ids you directly use in your code must be the SAME as the ids in the resource.h that corresponds of the ids string in the dialog.

If you try to access an non existing id (in the window) then a GPF occurs.

I think it is poor method of working.

For example you could try to make an array of ids


UINT myids={IDC_EDIT1,IDC_EDIT2,IDC_EDIT3};
for ( i=0; i<siseof(myids)/sizeof(UINT); i++) {
str.Format("%d", pdu.NbLine[m_PDUIndex + i]);
SetDlgItemText(myids(i), str);
.....
}




hope this helps