X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/69d16e3ef87c21364456307b5df88c2f4962b63d..6d9022fe3bb50a75b9b5eaf5cf32558e518ba310:/samples/oleauto/oleauto.cpp?ds=sidebyside diff --git a/samples/oleauto/oleauto.cpp b/samples/oleauto/oleauto.cpp index b4021b93ae..1c745b8519 100644 --- a/samples/oleauto/oleauto.cpp +++ b/samples/oleauto/oleauto.cpp @@ -40,11 +40,15 @@ #error "Sorry, this sample works under Windows only." #endif +#ifdef __WATCOMC__ +#error "Sorry, Watcom C++ does not support wxAutomationObject." +#endif + // ---------------------------------------------------------------------------- // ressources // ---------------------------------------------------------------------------- // the application icon -#if defined(__WXGTK__) || defined(__WXMOTIF__) +#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) #include "mondrian.xpm" #endif @@ -197,26 +201,26 @@ void MyFrame::OnTest(wxCommandEvent& WXUNUSED(event)) { wxMessageBox("Please ensure Excel is running, then press OK.\nThe active cell should then say 'wxWindows automation test!' in bold."); - wxAutomationObject excelObject, rangeObject; - if (!excelObject.GetInstance("Excel.Application")) - { + wxAutomationObject excelObject, rangeObject; + if (!excelObject.GetInstance("Excel.Application")) + { if (!excelObject.CreateInstance("Excel.Application")) { - wxMessageBox("Could not create Excel object."); - return; + wxMessageBox("Could not create Excel object."); + return; } - } - if (!excelObject.PutProperty("ActiveCell.Value", "wxWindows automation test!")) - { - wxMessageBox("Could not set active cell value."); - return; - } + } + if (!excelObject.PutProperty("ActiveCell.Value", "wxWindows automation test!")) + { + wxMessageBox("Could not set active cell value."); + return; + } #ifdef HAVE_BOOL - if (!excelObject.PutProperty("ActiveCell.Font.Bold", wxVariant((bool) TRUE)) ) - { - wxMessageBox("Could not put Bold property to active cell."); - return; - } + if (!excelObject.PutProperty("ActiveCell.Font.Bold", wxVariant((bool) TRUE)) ) + { + wxMessageBox("Could not put Bold property to active cell."); + return; + } #endif }