"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
It would be a great help if we knew what line it occurs on! Adding a
comment like
// <== line 854
would go a long way to helping us understand what is going on here.
Offhand I don't see anything in this code that would generate that
error.
joe
On Tue, 22 Apr 2008 16:23:04 GMT, "Kahlua" <kahlua@right.here> wrote:
When I build this I get the following error:
C:\MyProjects\MyDlg.cpp(854) : error C2120: 'void' illegal with all
types
Never seen this error before.
Thanks for all the help here so far.
void CMyDlg::OnClickhere()
{
CByteArray buffer;
CFile out;
for (int i=0; i<20; i++) //just inserting some binary test data to
buffer
buffer.InsertAt(i, 0x05);
if(out.Write(buffer.GetData(), buffer.GetSize()) != buffer.GetSize()){
DWORD err = ::GetLastError();
CString msg;
msg.Format(_T("Error writing file: %d"), err);
AfxMessageBox(msg);
return;
}
out.Close();
}
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm