/////////////////////////////////////////////////////////////////////// /// ManagedCPP.cpp - Demonstrates Managed C++ by reading /// /// ver 1.0 a few lines from a specified text file. /// /// /// /// Language: Visual C++, ver 6.0 /// /// Platform: Dell Dimension 8100, Windows Pro 2000 /// /// Application: CSE681 Example /// /// Author: Jim Fawcett, CST 2-187, Syracuse Univ. /// /// (315) 443-3948, jfawcett@twcny.rr.com /// /////////////////////////////////////////////////////////////////////// /* Public Interface: ----------------- Simply execute and observe a demonstration of managed C++ */ /////////////////////////////////////////////////////////////////////// /// build process /// /////////////////////////////////////////////////////////////////////// /// Required Files: /// /// managedCPP.cpp, TopReader.h, TopReader.cpp /// /// Compile Command: /// /// cl managedCPP.cpp TopReader.cpp /// /// Run Command: /// /// managedCPP TopReader.j ( or any other text file ) /// /////////////////////////////////////////////////////////////////////// /* Maintenance History =================== ver 1.0 : 09/04/02 - first release */ // #include "stdafx.h" //#include #include #include "TopReader.h" using namespace System; int main(int argc, char* argv[]) { Console::Write("\n Demonstrating Managed C++"); Console::Write("\n ===========================\n\n"); if(argc < 2) { std::cout << "\n Please enter name of file to process\n"; return 1; } // read first command line argument as fully qual. file name String^ path = Path::GetFullPath(gcnew String(argv[1])); TopReader^ pTR = gcnew TopReader(); if(pTR->SetFile(path)) pTR->ShowLines(20); else Console::WriteLine("\n Could not open file {0}\n\n",path); Console::Write("\n\n"); return 0; }