[CODE]
// CFileExample.cpp#include <AFX.H>
#include <ASSERT.H>
#include <iostream.h>#define NULL 0
// The constant SIZE_OF_BYTES can be modified if you want.
#define SIZE_OF_BYTES 256int main(int argc, char * argv[])
{
assert(argc == 3); CFile * pFile = NULL;
CFile * pNewFile = NULL;
char buffer[SIZE_OF_BYTES]; try
{
pFile = new CFile(argv[1], CFile::modeRead | CFile::typeBinary);
cout << "******* The source file's messages: *******";
cout << "\n\tName: " << pFile->GetFileName();
cout << "\n\tTitle: " << pFile->GetFileTitle();
cout << "\n\tPath: " << pFile->GetFilePath();
cout << "\n******* The End *******\n"; pNewFile = new CFile(argv[2], CFile::modeCreate | CFile::modeWrite | CFile:
:typeBinary);
cout << "*******  The destination file's messages: *******";

cout << "\n\tName: " << pNewFile->GetFileName();
cout << "\n\tTitle: " << pNewFile->GetFileTitle();
cout << "\n\tPath: " << pNewFile->GetFilePath();
cout << "\n******* The End *******\n";

// Copy the contents of source file to destination file.
while (pFile->ReadHuge(buffer, SIZE_OF_BYTES))
{
pNewFile->WriteHuge(buffer, SIZE_OF_BYTES);
}

pFile->Close();
pNewFile->Close();
}
catch (CFileException & rEx)
{
rEx.ReportError();
} return 0;
}
[/CODE]
此代码编译能通过,但链接时会出现以下错误信息:
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endth
readex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __begin
threadex
Debug/CFileExample.exe : fatal error LNK1120: 2 unresolved externals
愚初学VC编程,对其中之错误百思不得其解。还恳请好心的大虾们霸道相助!
愚再次先谢过乐!