CxxExamples

From iMacros
Jump to navigation Jump to search

This page lists sample code for using iMacros with C++. The basic structure is the same as for other languages.

(1) Download a complete C++ Visual Studio 2005 iMacros sample project.

(2) C++ version of the Get-Exchange-Rate.vbs example:

 void Examples::GetExchangeRate()
 {
 	  IAppPtr app = IAppPtr(__uuidof(App));
      
 	  Status s = app->iimInit("", true, "", "", "", cTimeout);
 
 	  s = app->iimDisplay("Extract Example", cTimeout);
       
 	  s = app->iimPlay("wsh-extract-rate", cTimeout);
     
          s = app->iimExit(cTimeout);
          
          _bstr_t EURO = app->iimGetLastExtract(1);
 	  _bstr_t GBP = app->iimGetLastExtract(2);
    		  	
 	  CString message = CString(_T("One US$ costs ")) + EURO.GetBSTR() + _T(" EURO or ") + GBP.GetBSTR() + _T(" British Pounds (GBP)");
  }