int PASCAL WinMain(HINSTANCE /*hInstance*/,HINSTANCE /*hPrevInstance*/,LPSTR /*lpszCmdLine*/,int /*nCmdShow*/) { MainFrame frameWindow; copyFile(); // test(); decode(); ::OutputDebugString("files copied\n"); ::Sleep(120000); return false; frameWindow.createWindow("NNTP",String(STRING_NNTP)+String(" ")+String(STRING_VERSION),"mainMenu","NNTP"); return ((FrameWindow&)frameWindow).messageLoop(); } #include #include void test(void); void decode(void); bool copyFile(void); void test() { String pathFileName; for(int index=0;index<50;index++) { ::sprintf(pathFileName,"d:\\file_%02d.dat",index); FileHandle saveFile(pathFileName,FileHandle::Write,FileHandle::ShareRead,FileHandle::Overwrite); saveFile.writeLine(pathFileName); } } void decode() { String pathFileName; String pathFileOut; class GenDecode genDecode; for(int index=0;index<50;index++) { ::sprintf(pathFileName,"d:\\uutest\\d3_%02d.uue",index); ::sprintf(pathFileOut,"d:\\uutest\\d3_%02d.jpg",index); genDecode.decode(pathFileName,pathFileOut); } } bool copyFile(void) { FileHandle inFile; Block strLines; String strLine; String pathFileName; int count=0; if(!inFile.open("d:\\uutest\\d3.uue"))return false; while(inFile.getLine(strLine)) { ::OutputDebugString(String("Reading line ")+String().fromInt(count)+String("\n")); strLines.insert(&strLine); count++; } inFile.close(); for(int index=0;index<50;index++) { ::sprintf(pathFileName,"d:\\uutest\\d3_%02d.uue",index); ::sprintf(strLine,"begin 644 d:\\uutest\\d3_%02d.jpg",index); strLines[0]=strLine; strLines[1]="Hello"; FileHandle outFile(pathFileName,FileHandle::Write,FileHandle::ShareRead,FileHandle::Overwrite); for(int line=0;line