#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
{
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.Font.Bold", (bool) TRUE))
- {
- wxMessageBox("Could not put Bold property to active cell.");
- 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;
+ }
+#endif
}