@nbaztec: The += operator does not work with integers.
1) ListBox is most likely a private member of MyProgDlg.cpp and is therefore unaccessible outside that class.
2) CString class has a Format() method whose parameters are identiacal to sprintf()
CString str;
DWORD dbIndex = 123;
str.Format("Line# %u", devIndex);