wx/msw/ole/dropsrc.h \
wx/msw/ole/droptgt.h \
wx/msw/ole/oleutils.h \
+ wx/msw/ole/safearray.h \
wx/msw/ownerdrw.h \
wx/msw/palette.h \
wx/msw/panel.h \
wx/msw/ole/dropsrc.h \
wx/msw/ole/droptgt.h \
wx/msw/ole/oleutils.h \
+ wx/msw/ole/safearray.h \
wx/msw/ownerdrw.h \
wx/msw/palette.h \
wx/msw/panel.h \
monodll_dropsrc.o \
monodll_droptgt.o \
monodll_oleutils.o \
+ monodll_safearray.o \
monodll_msw_palette.o \
monodll_msw_pen.o \
monodll_msw_popupwin.o \
monodll_dropsrc.o \
monodll_droptgt.o \
monodll_oleutils.o \
+ monodll_safearray.o \
monodll_msw_palette.o \
monodll_msw_pen.o \
monodll_msw_popupwin.o \
monodll_dropsrc.o \
monodll_droptgt.o \
monodll_oleutils.o \
+ monodll_safearray.o \
monodll_msw_palette.o \
monodll_msw_pen.o \
monodll_msw_popupwin.o \
monodll_dropsrc.o \
monodll_droptgt.o \
monodll_oleutils.o \
+ monodll_safearray.o \
monodll_msw_palette.o \
monodll_msw_pen.o \
monodll_msw_popupwin.o \
monolib_dropsrc.o \
monolib_droptgt.o \
monolib_oleutils.o \
+ monolib_safearray.o \
monolib_msw_palette.o \
monolib_msw_pen.o \
monolib_msw_popupwin.o \
monolib_dropsrc.o \
monolib_droptgt.o \
monolib_oleutils.o \
+ monolib_safearray.o \
monolib_msw_palette.o \
monolib_msw_pen.o \
monolib_msw_popupwin.o \
monolib_dropsrc.o \
monolib_droptgt.o \
monolib_oleutils.o \
+ monolib_safearray.o \
monolib_msw_palette.o \
monolib_msw_pen.o \
monolib_msw_popupwin.o \
monolib_dropsrc.o \
monolib_droptgt.o \
monolib_oleutils.o \
+ monolib_safearray.o \
monolib_msw_palette.o \
monolib_msw_pen.o \
monolib_msw_popupwin.o \
coredll_dropsrc.o \
coredll_droptgt.o \
coredll_oleutils.o \
+ coredll_safearray.o \
coredll_msw_palette.o \
coredll_msw_pen.o \
coredll_msw_popupwin.o \
coredll_dropsrc.o \
coredll_droptgt.o \
coredll_oleutils.o \
+ coredll_safearray.o \
coredll_msw_palette.o \
coredll_msw_pen.o \
coredll_msw_popupwin.o \
coredll_dropsrc.o \
coredll_droptgt.o \
coredll_oleutils.o \
+ coredll_safearray.o \
coredll_msw_palette.o \
coredll_msw_pen.o \
coredll_msw_popupwin.o \
coredll_dropsrc.o \
coredll_droptgt.o \
coredll_oleutils.o \
+ coredll_safearray.o \
coredll_msw_palette.o \
coredll_msw_pen.o \
coredll_msw_popupwin.o \
corelib_dropsrc.o \
corelib_droptgt.o \
corelib_oleutils.o \
+ corelib_safearray.o \
corelib_msw_palette.o \
corelib_msw_pen.o \
corelib_msw_popupwin.o \
corelib_dropsrc.o \
corelib_droptgt.o \
corelib_oleutils.o \
+ corelib_safearray.o \
corelib_msw_palette.o \
corelib_msw_pen.o \
corelib_msw_popupwin.o \
corelib_dropsrc.o \
corelib_droptgt.o \
corelib_oleutils.o \
+ corelib_safearray.o \
corelib_msw_palette.o \
corelib_msw_pen.o \
corelib_msw_popupwin.o \
corelib_dropsrc.o \
corelib_droptgt.o \
corelib_oleutils.o \
+ corelib_safearray.o \
corelib_msw_palette.o \
corelib_msw_pen.o \
corelib_msw_popupwin.o \
@COND_TOOLKIT_WINCE_USE_GUI_1@monodll_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(MONODLL_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp
+@COND_TOOLKIT_MSW_USE_GUI_1@monodll_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp
+
+@COND_TOOLKIT_WINCE_USE_GUI_1@monodll_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp
+
@COND_TOOLKIT_MSW_USE_GUI_1@monodll_msw_palette.o: $(srcdir)/src/msw/palette.cpp $(MONODLL_ODEP)
@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/palette.cpp
@COND_TOOLKIT_WINCE_USE_GUI_1@monolib_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(MONOLIB_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp
+@COND_TOOLKIT_MSW_USE_GUI_1@monolib_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp
+
+@COND_TOOLKIT_WINCE_USE_GUI_1@monolib_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp
+
@COND_TOOLKIT_MSW_USE_GUI_1@monolib_msw_palette.o: $(srcdir)/src/msw/palette.cpp $(MONOLIB_ODEP)
@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/palette.cpp
@COND_TOOLKIT_WINCE_USE_GUI_1@coredll_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(COREDLL_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp
+@COND_TOOLKIT_MSW_USE_GUI_1@coredll_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp
+
+@COND_TOOLKIT_WINCE_USE_GUI_1@coredll_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp
+
@COND_TOOLKIT_MSW_USE_GUI_1@coredll_msw_palette.o: $(srcdir)/src/msw/palette.cpp $(COREDLL_ODEP)
@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/palette.cpp
@COND_TOOLKIT_WINCE_USE_GUI_1@corelib_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(CORELIB_ODEP)
@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp
+@COND_TOOLKIT_MSW_USE_GUI_1@corelib_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp
+
+@COND_TOOLKIT_WINCE_USE_GUI_1@corelib_safearray.o: $(srcdir)/src/msw/ole/safearray.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/safearray.cpp
+
@COND_TOOLKIT_MSW_USE_GUI_1@corelib_msw_palette.o: $(srcdir)/src/msw/palette.cpp $(CORELIB_ODEP)
@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/palette.cpp
src/msw/ole/dropsrc.cpp
src/msw/ole/droptgt.cpp
src/msw/ole/oleutils.cpp
+ src/msw/ole/safearray.cpp
src/msw/palette.cpp
src/msw/pen.cpp
src/msw/popupwin.cpp
wx/msw/ole/dropsrc.h
wx/msw/ole/droptgt.h
wx/msw/ole/oleutils.h
+ wx/msw/ole/safearray.h
wx/msw/ownerdrw.h
wx/msw/palette.h
wx/msw/panel.h
$(OBJS)\monodll_dropsrc.obj \\r
$(OBJS)\monodll_droptgt.obj \\r
$(OBJS)\monodll_oleutils.obj \\r
+ $(OBJS)\monodll_safearray.obj \\r
$(OBJS)\monodll_palette.obj \\r
$(OBJS)\monodll_pen.obj \\r
$(OBJS)\monodll_popupwin.obj \\r
$(OBJS)\monodll_dropsrc.obj \\r
$(OBJS)\monodll_droptgt.obj \\r
$(OBJS)\monodll_oleutils.obj \\r
+ $(OBJS)\monodll_safearray.obj \\r
$(OBJS)\monodll_palette.obj \\r
$(OBJS)\monodll_pen.obj \\r
$(OBJS)\monodll_popupwin.obj \\r
$(OBJS)\monolib_dropsrc.obj \\r
$(OBJS)\monolib_droptgt.obj \\r
$(OBJS)\monolib_oleutils.obj \\r
+ $(OBJS)\monolib_safearray.obj \\r
$(OBJS)\monolib_palette.obj \\r
$(OBJS)\monolib_pen.obj \\r
$(OBJS)\monolib_popupwin.obj \\r
$(OBJS)\monolib_dropsrc.obj \\r
$(OBJS)\monolib_droptgt.obj \\r
$(OBJS)\monolib_oleutils.obj \\r
+ $(OBJS)\monolib_safearray.obj \\r
$(OBJS)\monolib_palette.obj \\r
$(OBJS)\monolib_pen.obj \\r
$(OBJS)\monolib_popupwin.obj \\r
$(OBJS)\coredll_dropsrc.obj \\r
$(OBJS)\coredll_droptgt.obj \\r
$(OBJS)\coredll_oleutils.obj \\r
+ $(OBJS)\coredll_safearray.obj \\r
$(OBJS)\coredll_palette.obj \\r
$(OBJS)\coredll_pen.obj \\r
$(OBJS)\coredll_popupwin.obj \\r
$(OBJS)\coredll_dropsrc.obj \\r
$(OBJS)\coredll_droptgt.obj \\r
$(OBJS)\coredll_oleutils.obj \\r
+ $(OBJS)\coredll_safearray.obj \\r
$(OBJS)\coredll_palette.obj \\r
$(OBJS)\coredll_pen.obj \\r
$(OBJS)\coredll_popupwin.obj \\r
$(OBJS)\corelib_dropsrc.obj \\r
$(OBJS)\corelib_droptgt.obj \\r
$(OBJS)\corelib_oleutils.obj \\r
+ $(OBJS)\corelib_safearray.obj \\r
$(OBJS)\corelib_palette.obj \\r
$(OBJS)\corelib_pen.obj \\r
$(OBJS)\corelib_popupwin.obj \\r
$(OBJS)\corelib_dropsrc.obj \\r
$(OBJS)\corelib_droptgt.obj \\r
$(OBJS)\corelib_oleutils.obj \\r
+ $(OBJS)\corelib_safearray.obj \\r
$(OBJS)\corelib_palette.obj \\r
$(OBJS)\corelib_pen.obj \\r
$(OBJS)\corelib_popupwin.obj \\r
$(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\ole\oleutils.cpp\r
!endif\r
\r
+!if "$(USE_GUI)" == "1"\r
+$(OBJS)\monodll_safearray.obj: ..\..\src\msw\ole\safearray.cpp\r
+ $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\ole\safearray.cpp\r
+!endif\r
+\r
!if "$(USE_GUI)" == "1"\r
$(OBJS)\monodll_palette.obj: ..\..\src\msw\palette.cpp\r
$(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\palette.cpp\r
$(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\ole\oleutils.cpp\r
!endif\r
\r
+!if "$(USE_GUI)" == "1"\r
+$(OBJS)\monolib_safearray.obj: ..\..\src\msw\ole\safearray.cpp\r
+ $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\ole\safearray.cpp\r
+!endif\r
+\r
!if "$(USE_GUI)" == "1"\r
$(OBJS)\monolib_palette.obj: ..\..\src\msw\palette.cpp\r
$(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\palette.cpp\r
$(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\ole\oleutils.cpp\r
!endif\r
\r
+!if "$(USE_GUI)" == "1"\r
+$(OBJS)\coredll_safearray.obj: ..\..\src\msw\ole\safearray.cpp\r
+ $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\ole\safearray.cpp\r
+!endif\r
+\r
!if "$(USE_GUI)" == "1"\r
$(OBJS)\coredll_palette.obj: ..\..\src\msw\palette.cpp\r
$(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\palette.cpp\r
$(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\ole\oleutils.cpp\r
!endif\r
\r
+!if "$(USE_GUI)" == "1"\r
+$(OBJS)\corelib_safearray.obj: ..\..\src\msw\ole\safearray.cpp\r
+ $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\ole\safearray.cpp\r
+!endif\r
+\r
!if "$(USE_GUI)" == "1"\r
$(OBJS)\corelib_palette.obj: ..\..\src\msw\palette.cpp\r
$(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\palette.cpp\r
$(OBJS)\monodll_dropsrc.o \\r
$(OBJS)\monodll_droptgt.o \\r
$(OBJS)\monodll_oleutils.o \\r
+ $(OBJS)\monodll_safearray.o \\r
$(OBJS)\monodll_palette.o \\r
$(OBJS)\monodll_pen.o \\r
$(OBJS)\monodll_popupwin.o \\r
$(OBJS)\monodll_dropsrc.o \\r
$(OBJS)\monodll_droptgt.o \\r
$(OBJS)\monodll_oleutils.o \\r
+ $(OBJS)\monodll_safearray.o \\r
$(OBJS)\monodll_palette.o \\r
$(OBJS)\monodll_pen.o \\r
$(OBJS)\monodll_popupwin.o \\r
$(OBJS)\monolib_dropsrc.o \\r
$(OBJS)\monolib_droptgt.o \\r
$(OBJS)\monolib_oleutils.o \\r
+ $(OBJS)\monolib_safearray.o \\r
$(OBJS)\monolib_palette.o \\r
$(OBJS)\monolib_pen.o \\r
$(OBJS)\monolib_popupwin.o \\r
$(OBJS)\monolib_dropsrc.o \\r
$(OBJS)\monolib_droptgt.o \\r
$(OBJS)\monolib_oleutils.o \\r
+ $(OBJS)\monolib_safearray.o \\r
$(OBJS)\monolib_palette.o \\r
$(OBJS)\monolib_pen.o \\r
$(OBJS)\monolib_popupwin.o \\r
$(OBJS)\coredll_dropsrc.o \\r
$(OBJS)\coredll_droptgt.o \\r
$(OBJS)\coredll_oleutils.o \\r
+ $(OBJS)\coredll_safearray.o \\r
$(OBJS)\coredll_palette.o \\r
$(OBJS)\coredll_pen.o \\r
$(OBJS)\coredll_popupwin.o \\r
$(OBJS)\coredll_dropsrc.o \\r
$(OBJS)\coredll_droptgt.o \\r
$(OBJS)\coredll_oleutils.o \\r
+ $(OBJS)\coredll_safearray.o \\r
$(OBJS)\coredll_palette.o \\r
$(OBJS)\coredll_pen.o \\r
$(OBJS)\coredll_popupwin.o \\r
$(OBJS)\corelib_dropsrc.o \\r
$(OBJS)\corelib_droptgt.o \\r
$(OBJS)\corelib_oleutils.o \\r
+ $(OBJS)\corelib_safearray.o \\r
$(OBJS)\corelib_palette.o \\r
$(OBJS)\corelib_pen.o \\r
$(OBJS)\corelib_popupwin.o \\r
$(OBJS)\corelib_dropsrc.o \\r
$(OBJS)\corelib_droptgt.o \\r
$(OBJS)\corelib_oleutils.o \\r
+ $(OBJS)\corelib_safearray.o \\r
$(OBJS)\corelib_palette.o \\r
$(OBJS)\corelib_pen.o \\r
$(OBJS)\corelib_popupwin.o \\r
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<\r
endif\r
\r
+ifeq ($(USE_GUI),1)\r
+$(OBJS)\monodll_safearray.o: ../../src/msw/ole/safearray.cpp\r
+ $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<\r
+endif\r
+\r
ifeq ($(USE_GUI),1)\r
$(OBJS)\monodll_palette.o: ../../src/msw/palette.cpp\r
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<\r
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<\r
endif\r
\r
+ifeq ($(USE_GUI),1)\r
+$(OBJS)\monolib_safearray.o: ../../src/msw/ole/safearray.cpp\r
+ $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<\r
+endif\r
+\r
ifeq ($(USE_GUI),1)\r
$(OBJS)\monolib_palette.o: ../../src/msw/palette.cpp\r
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<\r
$(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<\r
endif\r
\r
+ifeq ($(USE_GUI),1)\r
+$(OBJS)\coredll_safearray.o: ../../src/msw/ole/safearray.cpp\r
+ $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<\r
+endif\r
+\r
ifeq ($(USE_GUI),1)\r
$(OBJS)\coredll_palette.o: ../../src/msw/palette.cpp\r
$(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<\r
$(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<\r
endif\r
\r
+ifeq ($(USE_GUI),1)\r
+$(OBJS)\corelib_safearray.o: ../../src/msw/ole/safearray.cpp\r
+ $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<\r
+endif\r
+\r
ifeq ($(USE_GUI),1)\r
$(OBJS)\corelib_palette.o: ../../src/msw/palette.cpp\r
$(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<\r
$(OBJS)\monodll_dropsrc.obj \\r
$(OBJS)\monodll_droptgt.obj \\r
$(OBJS)\monodll_oleutils.obj \\r
+ $(OBJS)\monodll_safearray.obj \\r
$(OBJS)\monodll_palette.obj \\r
$(OBJS)\monodll_pen.obj \\r
$(OBJS)\monodll_popupwin.obj \\r
$(OBJS)\monodll_dropsrc.obj \\r
$(OBJS)\monodll_droptgt.obj \\r
$(OBJS)\monodll_oleutils.obj \\r
+ $(OBJS)\monodll_safearray.obj \\r
$(OBJS)\monodll_palette.obj \\r
$(OBJS)\monodll_pen.obj \\r
$(OBJS)\monodll_popupwin.obj \\r
$(OBJS)\monolib_dropsrc.obj \\r
$(OBJS)\monolib_droptgt.obj \\r
$(OBJS)\monolib_oleutils.obj \\r
+ $(OBJS)\monolib_safearray.obj \\r
$(OBJS)\monolib_palette.obj \\r
$(OBJS)\monolib_pen.obj \\r
$(OBJS)\monolib_popupwin.obj \\r
$(OBJS)\monolib_dropsrc.obj \\r
$(OBJS)\monolib_droptgt.obj \\r
$(OBJS)\monolib_oleutils.obj \\r
+ $(OBJS)\monolib_safearray.obj \\r
$(OBJS)\monolib_palette.obj \\r
$(OBJS)\monolib_pen.obj \\r
$(OBJS)\monolib_popupwin.obj \\r
$(OBJS)\coredll_dropsrc.obj \\r
$(OBJS)\coredll_droptgt.obj \\r
$(OBJS)\coredll_oleutils.obj \\r
+ $(OBJS)\coredll_safearray.obj \\r
$(OBJS)\coredll_palette.obj \\r
$(OBJS)\coredll_pen.obj \\r
$(OBJS)\coredll_popupwin.obj \\r
$(OBJS)\coredll_dropsrc.obj \\r
$(OBJS)\coredll_droptgt.obj \\r
$(OBJS)\coredll_oleutils.obj \\r
+ $(OBJS)\coredll_safearray.obj \\r
$(OBJS)\coredll_palette.obj \\r
$(OBJS)\coredll_pen.obj \\r
$(OBJS)\coredll_popupwin.obj \\r
$(OBJS)\corelib_dropsrc.obj \\r
$(OBJS)\corelib_droptgt.obj \\r
$(OBJS)\corelib_oleutils.obj \\r
+ $(OBJS)\corelib_safearray.obj \\r
$(OBJS)\corelib_palette.obj \\r
$(OBJS)\corelib_pen.obj \\r
$(OBJS)\corelib_popupwin.obj \\r
$(OBJS)\corelib_dropsrc.obj \\r
$(OBJS)\corelib_droptgt.obj \\r
$(OBJS)\corelib_oleutils.obj \\r
+ $(OBJS)\corelib_safearray.obj \\r
$(OBJS)\corelib_palette.obj \\r
$(OBJS)\corelib_pen.obj \\r
$(OBJS)\corelib_popupwin.obj \\r
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\ole\oleutils.cpp\r
!endif\r
\r
+!if "$(USE_GUI)" == "1"\r
+$(OBJS)\monodll_safearray.obj: ..\..\src\msw\ole\safearray.cpp\r
+ $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\ole\safearray.cpp\r
+!endif\r
+\r
!if "$(USE_GUI)" == "1"\r
$(OBJS)\monodll_palette.obj: ..\..\src\msw\palette.cpp\r
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\msw\palette.cpp\r
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\ole\oleutils.cpp\r
!endif\r
\r
+!if "$(USE_GUI)" == "1"\r
+$(OBJS)\monolib_safearray.obj: ..\..\src\msw\ole\safearray.cpp\r
+ $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\ole\safearray.cpp\r
+!endif\r
+\r
!if "$(USE_GUI)" == "1"\r
$(OBJS)\monolib_palette.obj: ..\..\src\msw\palette.cpp\r
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\msw\palette.cpp\r
$(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\ole\oleutils.cpp\r
!endif\r
\r
+!if "$(USE_GUI)" == "1"\r
+$(OBJS)\coredll_safearray.obj: ..\..\src\msw\ole\safearray.cpp\r
+ $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\ole\safearray.cpp\r
+!endif\r
+\r
!if "$(USE_GUI)" == "1"\r
$(OBJS)\coredll_palette.obj: ..\..\src\msw\palette.cpp\r
$(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\msw\palette.cpp\r
$(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\ole\oleutils.cpp\r
!endif\r
\r
+!if "$(USE_GUI)" == "1"\r
+$(OBJS)\corelib_safearray.obj: ..\..\src\msw\ole\safearray.cpp\r
+ $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\ole\safearray.cpp\r
+!endif\r
+\r
!if "$(USE_GUI)" == "1"\r
$(OBJS)\corelib_palette.obj: ..\..\src\msw\palette.cpp\r
$(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\msw\palette.cpp\r
$(OBJS)\monodll_dropsrc.obj &\r
$(OBJS)\monodll_droptgt.obj &\r
$(OBJS)\monodll_oleutils.obj &\r
+ $(OBJS)\monodll_safearray.obj &\r
$(OBJS)\monodll_palette.obj &\r
$(OBJS)\monodll_pen.obj &\r
$(OBJS)\monodll_popupwin.obj &\r
$(OBJS)\monodll_dropsrc.obj &\r
$(OBJS)\monodll_droptgt.obj &\r
$(OBJS)\monodll_oleutils.obj &\r
+ $(OBJS)\monodll_safearray.obj &\r
$(OBJS)\monodll_palette.obj &\r
$(OBJS)\monodll_pen.obj &\r
$(OBJS)\monodll_popupwin.obj &\r
$(OBJS)\monolib_dropsrc.obj &\r
$(OBJS)\monolib_droptgt.obj &\r
$(OBJS)\monolib_oleutils.obj &\r
+ $(OBJS)\monolib_safearray.obj &\r
$(OBJS)\monolib_palette.obj &\r
$(OBJS)\monolib_pen.obj &\r
$(OBJS)\monolib_popupwin.obj &\r
$(OBJS)\monolib_dropsrc.obj &\r
$(OBJS)\monolib_droptgt.obj &\r
$(OBJS)\monolib_oleutils.obj &\r
+ $(OBJS)\monolib_safearray.obj &\r
$(OBJS)\monolib_palette.obj &\r
$(OBJS)\monolib_pen.obj &\r
$(OBJS)\monolib_popupwin.obj &\r
$(OBJS)\coredll_dropsrc.obj &\r
$(OBJS)\coredll_droptgt.obj &\r
$(OBJS)\coredll_oleutils.obj &\r
+ $(OBJS)\coredll_safearray.obj &\r
$(OBJS)\coredll_palette.obj &\r
$(OBJS)\coredll_pen.obj &\r
$(OBJS)\coredll_popupwin.obj &\r
$(OBJS)\coredll_dropsrc.obj &\r
$(OBJS)\coredll_droptgt.obj &\r
$(OBJS)\coredll_oleutils.obj &\r
+ $(OBJS)\coredll_safearray.obj &\r
$(OBJS)\coredll_palette.obj &\r
$(OBJS)\coredll_pen.obj &\r
$(OBJS)\coredll_popupwin.obj &\r
$(OBJS)\corelib_dropsrc.obj &\r
$(OBJS)\corelib_droptgt.obj &\r
$(OBJS)\corelib_oleutils.obj &\r
+ $(OBJS)\corelib_safearray.obj &\r
$(OBJS)\corelib_palette.obj &\r
$(OBJS)\corelib_pen.obj &\r
$(OBJS)\corelib_popupwin.obj &\r
$(OBJS)\corelib_dropsrc.obj &\r
$(OBJS)\corelib_droptgt.obj &\r
$(OBJS)\corelib_oleutils.obj &\r
+ $(OBJS)\corelib_safearray.obj &\r
$(OBJS)\corelib_palette.obj &\r
$(OBJS)\corelib_pen.obj &\r
$(OBJS)\corelib_popupwin.obj &\r
$(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<\r
!endif\r
\r
+!ifeq USE_GUI 1\r
+$(OBJS)\monodll_safearray.obj : .AUTODEPEND ..\..\src\msw\ole\safearray.cpp\r
+ $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<\r
+!endif\r
+\r
!ifeq USE_GUI 1\r
$(OBJS)\monodll_palette.obj : .AUTODEPEND ..\..\src\msw\palette.cpp\r
$(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<\r
$(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<\r
!endif\r
\r
+!ifeq USE_GUI 1\r
+$(OBJS)\monolib_safearray.obj : .AUTODEPEND ..\..\src\msw\ole\safearray.cpp\r
+ $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<\r
+!endif\r
+\r
!ifeq USE_GUI 1\r
$(OBJS)\monolib_palette.obj : .AUTODEPEND ..\..\src\msw\palette.cpp\r
$(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<\r
$(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<\r
!endif\r
\r
+!ifeq USE_GUI 1\r
+$(OBJS)\coredll_safearray.obj : .AUTODEPEND ..\..\src\msw\ole\safearray.cpp\r
+ $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<\r
+!endif\r
+\r
!ifeq USE_GUI 1\r
$(OBJS)\coredll_palette.obj : .AUTODEPEND ..\..\src\msw\palette.cpp\r
$(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<\r
$(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<\r
!endif\r
\r
+!ifeq USE_GUI 1\r
+$(OBJS)\corelib_safearray.obj : .AUTODEPEND ..\..\src\msw\ole\safearray.cpp\r
+ $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<\r
+!endif\r
+\r
!ifeq USE_GUI 1\r
$(OBJS)\corelib_palette.obj : .AUTODEPEND ..\..\src\msw\palette.cpp\r
$(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<\r
# End Source File\r
# Begin Source File\r
\r
+SOURCE=..\..\src\msw\ole\safearray.cpp\r
+# End Source File\r
+# Begin Source File\r
+\r
SOURCE=..\..\src\msw\scrolbar.cpp\r
\r
!IF "$(CFG)" == "core - Win32 DLL Universal Release"\r
# End Source File\r
# Begin Source File\r
\r
+SOURCE=..\..\include\wx\msw\ole\safearray.h\r
+# End Source File\r
+# Begin Source File\r
+\r
SOURCE=..\..\include\wx\msw\scrolbar.h\r
# End Source File\r
# Begin Source File\r
Name="DLL Universal Release|Win32"\r
ExcludedFromBuild="TRUE"/>\r
</File>\r
+ <File\r
+ RelativePath="..\..\src\msw\ole\safearray.cpp">\r
+ </File>\r
<File\r
RelativePath="..\..\src\msw\scrolbar.cpp">\r
<FileConfiguration\r
<File\r
RelativePath="..\..\include\wx\msw\richmsgdlg.h">\r
</File>\r
+ <File\r
+ RelativePath="..\..\include\wx\msw\ole\safearray.h">\r
+ </File>\r
<File\r
RelativePath="..\..\include\wx\msw\scrolbar.h">\r
</File>\r
ExcludedFromBuild="true"\r
/>\r
</File>\r
+ <File\r
+ RelativePath="..\..\src\msw\ole\safearray.cpp"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\..\src\msw\scrolbar.cpp"\r
>\r
RelativePath="..\..\include\wx\msw\richmsgdlg.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath="..\..\include\wx\msw\ole\safearray.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\..\include\wx\msw\scrolbar.h"\r
>\r
ExcludedFromBuild="true"\r
/>\r
</File>\r
+ <File\r
+ RelativePath="..\..\src\msw\ole\safearray.cpp"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\..\src\msw\scrolbar.cpp"\r
>\r
RelativePath="..\..\include\wx\msw\richmsgdlg.h"\r
>\r
</File>\r
+ <File\r
+ RelativePath="..\..\include\wx\msw\ole\safearray.h"\r
+ >\r
+ </File>\r
<File\r
RelativePath="..\..\include\wx\msw\scrolbar.h"\r
>\r
- Fix setting colours for the text part of wxComboBox (Igor Korot).
- Add support for CURRENCY and SCODE types to OLE Automation helpers (PB).
- Allow setting LCID used by wxAutomationObject (PB).
+- Better support for SAFEARRAY in OLE Automation code (PB).
- Fix calling Iconize(false) on hidden top level windows (Christian Walther).
- Don't send any events from wxSpinCtrl::SetRange() even if the value changed.
SCODE m_value;
};
+// wrapper for SAFEARRAY, used for passing multidimensional arrays in wxVariant
+class WXDLLIMPEXP_CORE wxVariantDataSafeArray : public wxVariantData
+{
+public:
+ wxEXPLICIT wxVariantDataSafeArray(SAFEARRAY* value = NULL)
+ {
+ m_value = value;
+ }
+
+ SAFEARRAY* GetValue() const { return m_value; }
+ void SetValue(SAFEARRAY* value) { m_value = value; }
+
+ virtual bool Eq(wxVariantData& data) const;
+
+#if wxUSE_STD_IOSTREAM
+ virtual bool Write(wxSTD ostream& str) const;
+#endif
+ virtual bool Write(wxString& str) const;
+
+ wxVariantData* Clone() const { return new wxVariantDataSafeArray(m_value); }
+ virtual wxString GetType() const { return wxS("safearray"); }
+
+ DECLARE_WXANY_CONVERSION()
+
+private:
+ SAFEARRAY* m_value;
+};
+
+
WXDLLIMPEXP_CORE bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant);
WXDLLIMPEXP_CORE bool wxConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant);
#endif // wxUSE_VARIANT
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// Name: msw/ole/safearray.h
+// Purpose: Helpers for working with OLE SAFEARRAYs.
+// Author: PB
+// Created: 2012-09-23
+// RCS-ID: $Id$
+// Copyright: (c) 2012 wxWidgets development team
+// Licence: wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _MSW_OLE_SAFEARRAY_H_
+#define _MSW_OLE_SAFEARRAY_H_
+
+#include "wx/msw/ole/oleutils.h"
+
+#if wxUSE_OLE && wxUSE_VARIANT
+
+/*
+ wxSafeArray is wxWidgets wrapper for working with MS Windows SAFEARRAYs.
+ It also has convenience functions for converting between SAFEARRAY
+ and wxVariant with list type or wxArrayString.
+*/
+
+// The base class with type-independent methods. It exists solely in order to
+// reduce the template bloat.
+class WXDLLIMPEXP_CORE wxSafeArrayBase
+{
+public:
+ // If owns a SAFEARRAY, it's unlocked and destroyed.
+ virtual ~wxSafeArrayBase() { Destroy(); }
+
+ // Unlocks and destroys the owned SAFEARRAY.
+ void Destroy();
+
+ // Unlocks the owned SAFEARRAY, returns it and gives up its ownership.
+ SAFEARRAY* Detach();
+
+ // Returns true if has a valid SAFEARRAY.
+ bool HasArray() const { return m_array != NULL; }
+
+ // Returns the number of dimensions.
+ size_t GetDim() const;
+
+ // Returns lower bound for dimension dim in bound. Dimensions start at 1.
+ bool GetLBound(size_t dim, long& bound) const;
+
+ // Returns upper bound for dimension dim in bound. Dimensions start at 1.
+ bool GetUBound(size_t dim, long& bound) const;
+
+ // Returns element count for dimension dim. Dimensions start at 1.
+ size_t GetCount(size_t dim) const;
+
+protected:
+ // Default constructor, protected so the class can't be used on its own,
+ // it's only used as a base class of wxSafeArray<>.
+ wxSafeArrayBase()
+ {
+ m_array = NULL;
+ }
+
+ bool Lock();
+ bool Unlock();
+
+ SAFEARRAY* m_array;
+};
+
+// wxSafeArrayConvertor<> must be specialized for the type in order to allow
+// using it with wxSafeArray<>.
+//
+// We specialize it below for the standard types.
+template <VARTYPE varType>
+struct wxSafeArrayConvertor {};
+
+/**
+ Macro for specializing wxSafeArrayConvertor for simple types.
+
+ The template parameters are:
+ - externType: basic C data type, e.g. wxFloat64 or wxInt32
+ - varType: corresponding VARIANT type constant, e.g. VT_R8 or VT_I4.
+*/
+#define wxSPECIALIZE_WXSAFEARRAY_CONVERTOR_SIMPLE(externType, varType) \
+template <> \
+struct wxSafeArrayConvertor<varType> \
+{ \
+ typedef externType externT; \
+ typedef externT internT; \
+ static bool ToArray(const externT& from, internT& to) \
+ { \
+ to = from; \
+ return true; \
+ } \
+ static bool FromArray(const internT& from, externT& to) \
+ { \
+ to = from; \
+ return true; \
+ } \
+}
+
+wxSPECIALIZE_WXSAFEARRAY_CONVERTOR_SIMPLE(wxInt16, VT_I2);
+wxSPECIALIZE_WXSAFEARRAY_CONVERTOR_SIMPLE(wxInt32, VT_I4);
+wxSPECIALIZE_WXSAFEARRAY_CONVERTOR_SIMPLE(wxFloat32, VT_R4);
+wxSPECIALIZE_WXSAFEARRAY_CONVERTOR_SIMPLE(wxFloat64, VT_R8);
+
+// Specialization for VT_BSTR using wxString.
+template <>
+struct wxSafeArrayConvertor<VT_BSTR>
+{
+ typedef wxString externT;
+ typedef BSTR internT;
+
+ static bool ToArray(const wxString& from, BSTR& to)
+ {
+ BSTR bstr = wxConvertStringToOle(from);
+
+ if ( !bstr && !from.empty() )
+ {
+ // BSTR can be NULL for empty strings but if the string was
+ // not empty, it means we failed to allocate memory for it.
+ return false;
+ }
+ to = bstr;
+ return true;
+ }
+
+ static bool FromArray(const BSTR from, wxString& to)
+ {
+ to = wxConvertStringFromOle(from);
+ return true;
+ }
+};
+
+// Specialization for VT_VARIANT using wxVariant.
+template <>
+struct wxSafeArrayConvertor<VT_VARIANT>
+{
+ typedef wxVariant externT;
+ typedef VARIANT internT;
+
+ static bool ToArray(const wxVariant& from, VARIANT& to)
+ {
+ return wxConvertVariantToOle(from, to);
+ }
+
+ static bool FromArray(const VARIANT& from, wxVariant& to)
+ {
+ return wxConvertOleToVariant(from, to);
+ }
+};
+
+
+template <VARTYPE varType>
+class wxSafeArray : public wxSafeArrayBase
+{
+public:
+ typedef wxSafeArrayConvertor<varType> Convertor;
+ typedef typename Convertor::internT internT;
+ typedef typename Convertor::externT externT;
+
+ // Default constructor.
+ wxSafeArray()
+ {
+ m_array = NULL;
+ }
+
+ // Creates and locks a zero-based one-dimensional SAFEARRAY with the given
+ // number of elements.
+ bool Create(size_t count)
+ {
+ SAFEARRAYBOUND bound;
+
+ bound.lLbound = 0;
+ bound.cElements = count;
+ return Create(&bound, 1);
+ }
+
+ // Creates and locks a SAFEARRAY. See SafeArrayCreate() in MSDN
+ // documentation for more information.
+ bool Create(SAFEARRAYBOUND* bound, size_t dimensions)
+ {
+ wxCHECK_MSG( !m_array, false, wxS("Can't be created twice") );
+
+ m_array = SafeArrayCreate(varType, dimensions, bound);
+ if ( !m_array )
+ return false;
+
+ return Lock();
+ }
+
+ /**
+ Creates a 0-based one-dimensional SAFEARRAY from wxVariant with the
+ list type.
+
+ Can be called only for wxSafeArray<VT_VARIANT>.
+ */
+ bool CreateFromListVariant(const wxVariant& variant)
+ {
+ wxCHECK(varType == VT_VARIANT, false);
+ wxCHECK(variant.GetType() == wxS("list"), false);
+
+ if ( !Create(variant.GetCount()) )
+ return false;
+
+ VARIANT* data = static_cast<VARIANT*>(m_array->pvData);
+
+ for ( size_t i = 0; i < variant.GetCount(); i++)
+ {
+ if ( !Convertor::ToArray(variant[i], data[i]) )
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ Creates a 0-based one-dimensional SAFEARRAY from wxArrayString.
+
+ Can be called only for wxSafeArray<VT_BSTR>.
+ */
+ bool CreateFromArrayString(const wxArrayString& strings)
+ {
+ wxCHECK(varType == VT_BSTR, false);
+
+ if ( !Create(strings.size()) )
+ return false;
+
+ BSTR* data = static_cast<BSTR*>(m_array->pvData);
+
+ for ( size_t i = 0; i < strings.size(); i++ )
+ {
+ if ( !Convertor::ToArray(strings[i], data[i]) )
+ return false;
+ }
+ return true;
+ }
+
+ /**
+ Attaches and locks an existing SAFEARRAY.
+ The array must have the same VARTYPE as this wxSafeArray was
+ instantiated with.
+ */
+ bool Attach(SAFEARRAY* array)
+ {
+ wxCHECK_MSG(!m_array && array, false,
+ wxS("Can only attach a valid array to an uninitialized one") );
+
+ VARTYPE vt;
+ HRESULT hr = SafeArrayGetVartype(array, &vt);
+ if ( FAILED(hr) )
+ {
+ wxLogApiError(wxS("SafeArrayGetVarType()"), hr);
+ return false;
+ }
+
+ wxCHECK_MSG(vt == varType, false,
+ wxS("Attaching array of invalid type"));
+
+ m_array = array;
+ return Lock();
+ }
+
+ /**
+ Indices have the same row-column order as rgIndices in
+ SafeArrayPutElement(), i.e. they follow BASIC rules, NOT C ones.
+ */
+ bool SetElement(long* indices, const externT& element)
+ {
+ wxCHECK_MSG( m_array, false, wxS("Uninitialized array") );
+ wxCHECK_MSG( indices, false, wxS("Invalid index") );
+
+ internT* data;
+
+ if ( FAILED( SafeArrayPtrOfIndex(m_array, indices, (void**)&data) ) )
+ return false;
+
+ return Convertor::ToArray(element, *data);
+ }
+
+ /**
+ Indices have the same row-column order as rgIndices in
+ SafeArrayPutElement(), i.e. they follow BASIC rules, NOT C ones.
+ */
+ bool GetElement(long* indices, externT& element) const
+ {
+ wxCHECK_MSG( m_array, false, wxS("Uninitialized array") );
+ wxCHECK_MSG( indices, false, wxS("Invalid index") );
+
+ internT* data;
+
+ if ( FAILED( SafeArrayPtrOfIndex(m_array, indices, (void**)&data) ) )
+ return false;
+
+ return Convertor::FromArray(*data, element);
+ }
+
+ /**
+ Converts the array to a wxVariant with the list type, regardless of the
+ underlying SAFEARRAY type.
+
+ If the array is multidimensional, it is flattened using the alghoritm
+ originally employed in wxConvertOleToVariant().
+ */
+ bool ConvertToVariant(wxVariant& variant) const
+ {
+ wxCHECK_MSG( m_array, false, wxS("Uninitialized array") );
+
+ size_t dims = m_array->cDims;
+ size_t count = 1;
+
+ for ( size_t i = 0; i < dims; i++ )
+ count *= m_array->rgsabound[i].cElements;
+
+ const internT* data = static_cast<const internT*>(m_array->pvData);
+ externT element;
+
+ variant.ClearList();
+ for ( size_t i1 = 0; i1 < count; i1++ )
+ {
+ if ( !Convertor::FromArray(data[i1], element) )
+ {
+ variant.ClearList();
+ return false;
+ }
+ variant.Append(element);
+ }
+ return true;
+ }
+
+ /**
+ Converts an array to an ArrayString.
+
+ Can be called only for wxSafeArray<VT_BSTR>. If the array is
+ multidimensional, it is flattened using the alghoritm originally
+ employed in wxConvertOleToVariant().
+ */
+ bool ConvertToArrayString(wxArrayString& strings) const
+ {
+ wxCHECK_MSG( m_array, false, wxS("Uninitialized array") );
+ wxCHECK(varType == VT_BSTR, false);
+
+ size_t dims = m_array->cDims;
+ size_t count = 1;
+
+ for ( size_t i = 0; i < dims; i++ )
+ count *= m_array->rgsabound[i].cElements;
+
+ const BSTR* data = static_cast<const BSTR*>(m_array->pvData);
+ wxString element;
+
+ strings.clear();
+ strings.reserve(count);
+ for ( size_t i1 = 0; i1 < count; i1++ )
+ {
+ if ( !Convertor::FromArray(data[i1], element) )
+ {
+ strings.clear();
+ return false;
+ }
+ strings.push_back(element);
+ }
+ return true;
+ }
+
+ static bool ConvertToVariant(SAFEARRAY* psa, wxVariant& variant)
+ {
+ wxSafeArray<varType> sa;
+ bool result = false;
+
+ if ( sa.Attach(psa) )
+ result = sa.ConvertToVariant(variant);
+
+ if ( sa.HasArray() )
+ sa.Detach();
+
+ return result;
+ }
+
+ static bool ConvertToArrayString(SAFEARRAY* psa, wxArrayString& strings)
+ {
+ wxSafeArray<varType> sa;
+ bool result = false;
+
+ if ( sa.Attach(psa) )
+ result = sa.ConvertToArrayString(strings);
+
+ if ( sa.HasArray() )
+ sa.Detach();
+
+ return result;
+ }
+
+ wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxSafeArray, varType);
+};
+
+#endif // wxUSE_OLE && wxUSE_VARIANT
+
+#endif // _MSW_OLE_SAFEARRAY_H_
virtual bool GetAsAny(wxAny* any) const;
};
+/**
+ @class wxVariantDataSafeArray
+
+ This class represents a thin wrapper for Microsoft Windows SAFEARRAY type.
+
+ It is used for converting between wxVariant and OLE VARIANT
+ with type set to VT_ARRAY, which has more than one dimension.
+ When wxVariant stores wxVariantDataSafeArray, it returns "safearray" as its type.
+
+ wxVariantDataSafeArray does NOT manage the SAFEARRAY it points to.
+ If you want to pass it to a wxAutomationObject as a parameter:
+ -# Assign a SAFEARRAY pointer to it and store it in a wxVariant.
+ -# Call the wxAutomationObject method (CallMethod(), SetProperty() or Invoke())
+ -# wxAutomationObject will destroy the array after the approapriate automation call.
+
+ An example of creating a 2-dimensional SAFEARRAY containing VARIANTs
+ and storing it in a wxVariant
+ @code
+ SAFEARRAYBOUND bounds[2]; // 2 dimensions
+ wxSafeArray<VT_VARIANT> safeArray;
+ unsigned rowCount = 1000;
+ unsigned colCount = 20;
+
+ bounds[0].lLbound = 0; // elements start at 0
+ bounds[0].cElements = rowCount;
+ bounds[1].lLbound = 0; // elements start at 0
+ bounds[1].cElements = colCount;
+
+ if ( !safeArray.Create(bounds, 2) )
+ return false;
+
+ long indices[2];
+
+ for ( unsigned row = 0; row < rowCount; row++ )
+ {
+ indices[0] = row;
+ for ( unsigned col = 0; col < colCount; col++ )
+ {
+ indices[1] = col;
+ if ( !safeArray.SetElement(indices, wxString::Format("R%ud C%ud", i+1, j+1)) )(
+ return false;
+ }
+ }
+ range.PutProperty("Value", wxVariant(new wxVariantDataSafeArray(sa.Detach())));
+ @endcode
+
+ If you you received wxVariantDataSafeArray as a result of wxAutomationObject method call:
+ (1) Get the data out of the array.
+ (2) Destroy the array.
+ @code
+ wxVariant result;
+ result = range.GetProperty("Value");
+ if ( result.GetType() == "safearray" )
+ {
+ wxSafeArray<VT_VARIANT> safeArray;
+ wxVariantDataSafeArray* const
+ sa = wxStaticCastVariantData(variant.GetData(), wxVariantDataSafeArray);
+
+ if ( !safeArray.Attach(sa.GetValue() )
+ {
+ if ( !safeArray.HasArray() )
+ SafeArrayDestroy(sa.GetValue()); // we have to dispose the SAFEARRAY ourselves
+ return false;
+ }
+
+ // get the data from the SAFEARRAY using wxSafeArray::GetElement()
+ // SAFEARRAY will be disposed by safeArray's dtor
+ }
+ @endcode
+
+ @onlyfor{wxmsw}
+ @since 2.9.5
+
+ @library{wxcore}
+ @category{data}
+
+ @see wxAutomationObject, wxVariant, wxVariantData, wxVariantDataErrorCode
+
+ @header{wx/msw/ole/oleutils.h}
+*/
+class wxVariantDataSafeArray : public wxVariantData
+{
+public:
+ /**
+ Constructor initializes the object to @a value.
+ */
+ explicit wxVariantDataSafeArray(SAFEARRAY* value = NULL);
+
+ /**
+ Returns the stored array.
+ */
+ SAFEARRAY* GetValue() const;
+
+ /**
+ Set the stored array.
+ */
+ void SetValue(SAFEARRAY* value);
+
+ /**
+ Returns true if @a data is of wxVariantDataErrorCode type
+ and contains the same SCODE value.
+ */
+ virtual bool Eq(wxVariantData& data) const;
+
+ /**
+ Fills the provided string with the textual representation of this
+ object.
+
+ The error code is just a number, so it's output as such.
+ */
+ virtual bool Write(wxString& str) const;
+
+ /**
+ Returns a copy of itself.
+ */
+ wxVariantData* Clone() const;
+
+ /**
+ Returns "safearray".
+ */
+ virtual wxString GetType() const;
+
+ /**
+ Converts the value of this object to wxAny.
+ */
+ virtual bool GetAsAny(wxAny* any) const;
+};
/**
@class wxAutomationObject
@library{wxcore}
@category{data}
- @see wxVariant, wxVariantDataCurrency, wxVariantDataErrorCode
+ @see wxVariant, wxVariantDataCurrency, wxVariantDataErrorCode, wxVariantDataSafeArray
*/
class wxAutomationObject : public wxObject
{
the wxVariantData object, unlike the case for basic data types where
convenience functions such as GetLong() can be used.
- Under Microsoft Windows, two additional wxVariantData-derived classes --
- wxVariantDataCurrency and wxVariantDataErrorCode -- are available for
- interoperation with OLE VARIANT when using wxAutomationObject.
+ Under Microsoft Windows, three additional wxVariantData-derived classes --
+ wxVariantDataCurrency, wxVariantDataErrorCode and wxVariantDataSafeArray --
+ are available for interoperation with OLE VARIANT when using wxAutomationObject.
Pointers to any wxObject derived class can also easily be stored in a
wxVariant. wxVariant will then use wxWidgets' built-in RTTI system to set
{
vReturn.pdispVal = NULL;
}
+ // Mustn't free the SAFEARRAY if it is contained in the retValue
+ if ((vReturn.vt & VT_ARRAY) &&
+ retValue.GetType() == wxS("safearray"))
+ {
+ vReturn.parray = NULL;
+ }
}
}
return true;
#endif
#include "wx/msw/ole/oleutils.h"
+#include "wx/msw/ole/safearray.h"
#if defined(__VISUALC__) && (__VISUALC__ > 1000)
#include <docobj.h>
#if wxUSE_VARIANT
-namespace
-{
-
-// Helper class for creating and filling SAFEARRAY. To use it, call Create()
-// first, then SetElement() for each element and finally Detach() the SAFEARRAY
-// from it if you don't want it to be deleted when this class is.
-class wxSafeArrayHelper
-{
-public:
- wxSafeArrayHelper();
- ~wxSafeArrayHelper();
-
- bool Create(VARTYPE vt, long count); // creates and locks the array
-
- bool SetElement(size_t index, const wxVariant& variant);
- bool SetElement(size_t index, const wxString& str);
-
- SAFEARRAY* Detach(); // unlocks the array and gives up its ownership
-
-private:
- void Unlock();
-
- SAFEARRAY* m_array;
-};
-
-wxSafeArrayHelper::wxSafeArrayHelper()
-{
- m_array = NULL;
-}
-
-wxSafeArrayHelper::~wxSafeArrayHelper()
-{
- if ( m_array )
- {
- Unlock();
- SafeArrayDestroy(m_array);
- }
-}
-
-bool wxSafeArrayHelper::Create(VARTYPE vt, long count)
-{
- SAFEARRAYBOUND saBound;
-
- saBound.lLbound = 0;
- saBound.cElements = count;
- m_array = SafeArrayCreate(vt, 1, &saBound);
- if ( !m_array )
- return false;
- return SUCCEEDED( SafeArrayLock(m_array) );
-}
-
-bool wxSafeArrayHelper::SetElement(size_t index, const wxVariant& variant)
-{
- VARIANT* data = (VARIANT*)m_array->pvData;
- return wxConvertVariantToOle(variant, data[index]);
-}
-
-bool wxSafeArrayHelper::SetElement(size_t index, const wxString& str)
-{
- BSTR bstr = wxConvertStringToOle(str);
-
- if ( !bstr && !str.empty() )
- {
- // BSTR can be NULL for empty strings but if the string was
- // not empty, it means we failed to allocate memory for it.
- return false;
- }
-
- BSTR* data = (BSTR*)m_array->pvData;
- data[index] = bstr;
- return true;
-}
-
-SAFEARRAY* wxSafeArrayHelper::Detach()
-{
- Unlock();
- SAFEARRAY* result = m_array;
- m_array = NULL;
- return result;
-}
-
-void wxSafeArrayHelper::Unlock()
-{
- if ( m_array )
- SafeArrayUnlock(m_array);
-}
-
-} // unnamed namespace
-
-
// ----------------------------------------------------------------------------
// wxVariantDataCurrency
// ----------------------------------------------------------------------------
}
+// ----------------------------------------------------------------------------
+// wxVariantDataSafeArray
+// ----------------------------------------------------------------------------
+
+#if wxUSE_ANY
+
+bool wxVariantDataSafeArray::GetAsAny(wxAny* any) const
+{
+ *any = m_value;
+ return true;
+}
+
+wxVariantData* wxVariantDataSafeArray::VariantDataFactory(const wxAny& any)
+{
+ return new wxVariantDataSafeArray(wxANY_AS(any, SAFEARRAY*));
+}
+
+REGISTER_WXANY_CONVERSION(SAFEARRAY*, wxVariantDataSafeArray)
+
+#endif // wxUSE_ANY
+
+bool wxVariantDataSafeArray::Eq(wxVariantData& data) const
+{
+ wxASSERT_MSG( (data.GetType() == wxS("safearray")),
+ "wxVariantDataSafeArray::Eq: argument mismatch" );
+
+ wxVariantDataSafeArray& otherData = (wxVariantDataSafeArray&) data;
+
+ return otherData.m_value == m_value;
+}
+
+#if wxUSE_STD_IOSTREAM
+bool wxVariantDataSafeArray::Write(wxSTD ostream& str) const
+{
+ wxString s;
+ Write(s);
+ str << s;
+ return true;
+}
+#endif
+
+bool wxVariantDataSafeArray::Write(wxString& str) const
+{
+ str.Printf(wxS("SAFEARRAY: %p"), (void*)m_value);
+ return true;
+}
WXDLLEXPORT bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant)
{
oleVariant.vt = VT_CY;
oleVariant.cyVal = c->GetValue();
}
+ else if (type == wxT("safearray"))
+ {
+ wxVariantDataSafeArray* const
+ vsa = wxStaticCastVariantData(variant.GetData(),
+ wxVariantDataSafeArray);
+ SAFEARRAY* psa = vsa->GetValue();
+ VARTYPE vt;
+
+ wxCHECK(psa, false);
+ HRESULT hr = SafeArrayGetVartype(psa, &vt);
+ if ( FAILED(hr) )
+ {
+ wxLogApiError(wxS("SafeArrayGetVartype()"), hr);
+ SafeArrayDestroy(psa);
+ return false;
+ }
+ oleVariant.vt = vt | VT_ARRAY;
+ oleVariant.parray = psa;
+ }
else if (type == wxT("long"))
{
oleVariant.vt = VT_I4;
}
else if (type == wxT("list"))
{
- wxSafeArrayHelper sah;
-
- if (!sah.Create(VT_VARIANT, variant.GetCount()))
+ wxSafeArray<VT_VARIANT> safeArray;
+ if (!safeArray.CreateFromListVariant(variant))
return false;
- for (size_t i = 0; i < variant.GetCount(); i++)
- {
- if (!sah.SetElement(i, variant[i]))
- return false;
- }
-
oleVariant.vt = VT_VARIANT | VT_ARRAY;
- oleVariant.parray = sah.Detach();
+ oleVariant.parray = safeArray.Detach();
}
else if (type == wxT("arrstring"))
{
- wxArrayString strings(variant.GetArrayString());
- wxSafeArrayHelper sah;
+ wxSafeArray<VT_BSTR> safeArray;
- if (!sah.Create(VT_BSTR, strings.GetCount()))
+ if (!safeArray.CreateFromArrayString(variant.GetArrayString()))
return false;
- for (size_t i = 0; i < strings.GetCount(); i++)
- {
- if (!sah.SetElement(i, strings[i]))
- return false;
- }
-
oleVariant.vt = VT_BSTR | VT_ARRAY;
- oleVariant.parray = sah.Detach();
+ oleVariant.parray = safeArray.Detach();
}
else
{
bool ok = true;
if ( oleVariant.vt & VT_ARRAY )
{
-
- // Compute the total number of elements in all array dimensions
- int cElements = 1;
- for ( int cDims = 0; cDims < oleVariant.parray->cDims; cDims++ )
- cElements *= oleVariant.parray->rgsabound[cDims].cElements;
-
- // Get a pointer to the data
- void* pvdata;
- HRESULT hr = SafeArrayAccessData(oleVariant.parray, &pvdata);
- if ( FAILED(hr) )
- return false;
-
+ // TODO: We currently return arrays as wxVariant of the list type
+ // containing the flattened form of array but we should allow
+ // getting it as wxVariantDataSafeArray instead. Doing this is
+ // simple, we'd just need to do something like this:
+ //
+ // if ( oleVariant.parray && SafeArrayGetDim(oleVariant.parray) > 1 )
+ // {
+ // variant.SetData(new wxVariantDataSafeArray(oleVariant.parray));
+ // }
+ //
+ // but currently we don't do it for compatibility reasons.
switch (oleVariant.vt & VT_TYPEMASK)
{
+ case VT_I2:
+ ok = wxSafeArray<VT_I2>::ConvertToVariant(oleVariant.parray, variant);
+ break;
+ case VT_I4:
+ ok = wxSafeArray<VT_I4>::ConvertToVariant(oleVariant.parray, variant);
+ break;
+ case VT_R4:
+ ok = wxSafeArray<VT_R4>::ConvertToVariant(oleVariant.parray, variant);
+ break;
+ case VT_R8:
+ ok = wxSafeArray<VT_R8>::ConvertToVariant(oleVariant.parray, variant);
+ break;
case VT_VARIANT:
- {
- variant.ClearList();
- VARIANTARG *variant_data=(VARIANTARG*)pvdata;
- for ( int i = 0; i < cElements; i++ )
- {
- VARIANTARG& oleElement = variant_data[i];
- wxVariant vElement;
- if ( !wxConvertOleToVariant(oleElement, vElement) )
- {
- ok = false;
- variant.ClearList();
- break;
- }
-
- variant.Append(vElement);
- }
- }
+ ok = wxSafeArray<VT_VARIANT>::ConvertToVariant(oleVariant.parray, variant);
break;
-
case VT_BSTR:
{
wxArrayString strings;
- BSTR *string_val=(BSTR*)pvdata;
- for ( int i = 0; i < cElements; ++i )
- {
- wxString str=wxConvertStringFromOle(*string_val);
- strings.Add(str);
- ++string_val;
- }
- variant=strings;
+ if ( wxSafeArray<VT_BSTR>::ConvertToArrayString(oleVariant.parray, strings) )
+ variant = strings;
+ else
+ ok = false;
}
break;
-
default:
- wxLogDebug(wxT("unhandled VT_ARRAY type %x in wxConvertOleToVariant"),
- oleVariant.vt & VT_TYPEMASK);
- variant = wxVariant();
ok = false;
break;
}
-
- SafeArrayUnaccessData(oleVariant.parray);
+ if ( !ok )
+ {
+ wxLogDebug(wxT("unhandled VT_ARRAY type %x in wxConvertOleToVariant"),
+ oleVariant.vt & VT_TYPEMASK);
+ variant = wxVariant();
+ }
}
else if ( oleVariant.vt & VT_BYREF )
{
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// Name: msw/ole/safearray.cpp
+// Purpose: Implementation of wxSafeArrayBase class.
+// Author: PB
+// Created: 2012-09-23
+// RCS-ID: $Id$
+// Copyright: (c) 2012 wxWidgets development team
+// Licence: wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+ #include "wx/variant.h"
+#endif // WX_PRECOMP
+
+#include "wx/msw/ole/safearray.h"
+
+// ============================================================================
+// implementation
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// wxSafeArrayBase
+// ----------------------------------------------------------------------------
+
+void wxSafeArrayBase::Destroy()
+{
+ if ( m_array )
+ {
+ Unlock();
+ HRESULT hr = SafeArrayDestroy(m_array);
+ if ( FAILED(hr) )
+ {
+ wxLogApiError(wxS("SafeArrayDestroy()"), hr);
+ }
+ m_array = NULL;
+ }
+}
+
+SAFEARRAY* wxSafeArrayBase::Detach()
+{
+ wxCHECK_MSG( m_array, NULL, wxS("Uninitialized safe array") );
+
+ Unlock();
+ SAFEARRAY* array = m_array;
+ m_array = NULL;
+ return array;
+}
+
+size_t wxSafeArrayBase::GetDim() const
+{
+ wxASSERT( m_array );
+
+ return SafeArrayGetDim(m_array);
+}
+
+bool wxSafeArrayBase::GetLBound(size_t dim, long& bound) const
+{
+ wxCHECK_MSG( m_array, false, wxS("Uninitialized safe array") );
+ wxCHECK_MSG( dim > 0, false, wxS("Invalid dimension index") );
+
+ HRESULT hr = SafeArrayGetLBound(m_array, dim, &bound);
+ if ( FAILED(hr) )
+ {
+ wxLogApiError(wxS("SafeArrayGetLBound()"), hr);
+ return false;
+ }
+ return true;
+}
+
+bool wxSafeArrayBase::GetUBound(size_t dim, long& bound) const
+{
+ wxCHECK_MSG( m_array, false, wxS("Uninitialized safe array") );
+ wxCHECK_MSG( dim > 0, false, wxS("Invalid dimension index") );
+
+ HRESULT hr = SafeArrayGetUBound(m_array, dim, &bound);
+ if ( FAILED(hr) )
+ {
+ wxLogApiError(wxS("SafeArrayGetUBound()"), hr);
+ return false;
+ }
+ return true;
+}
+
+size_t wxSafeArrayBase::GetCount(size_t dim) const
+{
+ long lBound, uBound;
+
+ if ( GetLBound(dim, lBound) && GetUBound(dim, uBound) )
+ return uBound - lBound + 1;
+ return 0;
+}
+
+bool wxSafeArrayBase::Lock()
+{
+ wxCHECK_MSG( m_array, false, wxS("Uninitialized safe array") );
+
+ HRESULT hr = SafeArrayLock(m_array);
+ if ( FAILED(hr) )
+ {
+ wxLogApiError(wxS("SafeArrayLock()"), hr);
+ return false;
+ }
+ return true;
+}
+
+bool wxSafeArrayBase::Unlock()
+{
+ wxCHECK_MSG( m_array, false, wxS("Uninitialized safe array") );
+
+ HRESULT hr = SafeArrayUnlock(m_array);
+ if ( FAILED(hr) )
+ {
+ wxLogApiError(wxS("SafeArrayUnlock()"), hr);
+ return false;
+ }
+ return true;
+}
+
+