/////////////////////////////////////////////////////////////////////// /// BridgeToCPPengine.h - Shows how to use traditional, unmanaged /// /// ver 2.1 C++ packaged as a dll library from /// /// managed code. /// /// /// /// Language: Visual C++, ver 7.0, Visual Studio.Net /// /// 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: ----------------- Bridge br = new Bridge(); br.attach(someFile); br.getTok(tokStr); */ /////////////////////////////////////////////////////////////////////// /// build process /// /////////////////////////////////////////////////////////////////////// /// Required Files: /// /// BridgeToCPPengine.h, BridgeToCPPengine.cpp /// /// Compile Command: /// /// cl /MTd /LD BridgeToCPPengine.cpp /// /// Visual Studio IDE: /// /// - set compiler options to place dll in TestBridge/Debug /// /// - use managed C++ library project /// /// Run Command: /// /// none /// /////////////////////////////////////////////////////////////////////// /* Maintenance History =================== ver 2.1 : 29 Jan 04 - removed memory leak by deleting pToken in Bridge::GetTok(...). ver 2.0 : 25 Jan 04 - major simplifying redesign of Bridge class ver 1.0 : 13 Sep 02 - first release */ // #pragma once #using #include "tok.h" #include #include using namespace System; using namespace System::Text; namespace bridgeToCPPengine { // managed classes can't: // - be templated // - use friends // - use multiple inheritance public __gc class Bridge { // need gcroot here? toker* _pToker; std::istream* _pStream; String* UmsToMs(std::string* s); std::string* MsToUms(String* s); public: Bridge(); ~Bridge(); bool attach(String* fileName); bool GetTok(String*& pTok); }; }