From 17b74d79adcc7bbd5cff4ed500e267289c0083a7 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 4 Feb 1999 21:12:30 +0000 Subject: [PATCH] Fixed compilation for when not including git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1599 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/ole/automtn.h | 26 -------------------------- include/wx/wxprec.h | 2 +- samples/mfc/mfctest.cpp | 22 +++++++++------------- src/msw/ole/automtn.cpp | 35 +++++++++++++++++++++++++++++++++-- src/msw/ole/dataobj.cpp | 10 +++++++--- src/msw/ole/dropsrc.cpp | 7 ++++++- 6 files changed, 56 insertions(+), 46 deletions(-) diff --git a/include/wx/msw/ole/automtn.h b/include/wx/msw/ole/automtn.h index 412b04dcf4..b3598a5985 100644 --- a/include/wx/msw/ole/automtn.h +++ b/include/wx/msw/ole/automtn.h @@ -81,36 +81,10 @@ public: // without having to deal with nasty IDispatch pointers. bool GetObject(wxAutomationObject& obj, const wxString& property, int noArgs = 0, wxVariant args[] = (wxVariant*) NULL) const; - // Convert variants - static bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) ; - static bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant) ; - public: WXIDISPATCH* m_dispatchPtr; }; -// wrapper around BSTR type (by Vadim Zeitlin) - -class WXDLLEXPORT BasicString -{ -public: - // ctors & dtor - BasicString(const char *sz); - ~BasicString(); - - // accessors - // just get the string - operator BSTR() const { return m_wzBuf; } - // retrieve a copy of our string - caller must SysFreeString() it later! - BSTR Get() const { return SysAllocString(m_wzBuf); } - -private: - // @@@ not implemented (but should be) - BasicString(const BasicString&); - BasicString& operator=(const BasicString&); - - OLECHAR *m_wzBuf; // actual string -}; #endif // _WX_AUTOMTN_H_ diff --git a/include/wx/wxprec.h b/include/wx/wxprec.h index 6f542b6a45..940c4a6521 100644 --- a/include/wx/wxprec.h +++ b/include/wx/wxprec.h @@ -31,7 +31,7 @@ // Comment this out if you don't mind slower compilation of the wxWindows // library #if !defined(__WXMAC__) && !defined(__SALFORDC__) -#include +// #include #endif #ifdef GetClassInfo diff --git a/samples/mfc/mfctest.cpp b/samples/mfc/mfctest.cpp index cbbcd343c2..26e03e26fb 100644 --- a/samples/mfc/mfctest.cpp +++ b/samples/mfc/mfctest.cpp @@ -42,9 +42,7 @@ #pragma hdrstop #endif -#ifndef WX_PRECOMP #include "wx/wx.h" -#endif #ifdef new #undef new @@ -60,8 +58,6 @@ #include "mfctest.h" -#include "wx/wx.h" - ///////////////////////////////////////////////////////////////////////////// // theApp: @@ -95,7 +91,7 @@ class MyChild: public wxFrame MyCanvas *canvas; MyChild(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size, const long style); ~MyChild(void); - Bool OnClose(void); + bool OnClose(void); void OnQuit(wxCommandEvent& event); void OnNew(wxCommandEvent& event); @@ -269,7 +265,7 @@ bool MyApp::OnInit(void) wxFrame *MyApp::CreateFrame(void) { MyChild *subframe = new MyChild(NULL, "Canvas Frame", wxPoint(10, 10), wxSize(300, 300), - wxDEFAULT_FRAME); + wxDEFAULT_FRAME_STYLE); subframe->SetTitle("wxWindows canvas frame"); @@ -294,7 +290,7 @@ wxFrame *MyApp::CreateFrame(void) MyCanvas *canvas = new MyCanvas(subframe, wxPoint(0, 0), wxSize(width, height)); wxCursor *cursor = new wxCursor(wxCURSOR_PENCIL); - canvas->SetCursor(cursor); + canvas->SetCursor(*cursor); subframe->canvas = canvas; // Give it scrollbars @@ -321,13 +317,13 @@ void MyCanvas::OnPaint(wxPaintEvent& event) { wxPaintDC dc(this); - dc.SetFont(small_font); - dc.SetPen(wxGREEN_PEN); + dc.SetFont(* small_font); + dc.SetPen(* wxGREEN_PEN); dc.DrawLine(0, 0, 200, 200); dc.DrawLine(200, 0, 0, 200); - dc.SetBrush(wxCYAN_BRUSH); - dc.SetPen(wxRED_PEN); + dc.SetBrush(* wxCYAN_BRUSH); + dc.SetPen(* wxRED_PEN); dc.DrawRectangle(100, 100, 100, 50); dc.DrawRoundedRectangle(150, 150, 100, 50, 20); @@ -342,7 +338,7 @@ void MyCanvas::OnPaint(wxPaintEvent& event) void MyCanvas::OnMouseEvent(wxMouseEvent& event) { wxClientDC dc(this); - dc.SetPen(wxBLACK_PEN); + dc.SetPen(* wxBLACK_PEN); long x, y; event.Position(&x, &y); if (xpos > -1 && ypos > -1 && event.Dragging()) @@ -387,7 +383,7 @@ void MyChild::OnActivate(wxActivateEvent& event) canvas->SetFocus(); } -Bool MyChild::OnClose(void) +bool MyChild::OnClose(void) { return TRUE; } diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index e16be59a32..4d062412c7 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -29,6 +29,37 @@ #include #include +#ifdef GetObject +#undef GetObject +#endif + +// wrapper around BSTR type (by Vadim Zeitlin) + +class WXDLLEXPORT BasicString +{ +public: + // ctors & dtor + BasicString(const char *sz); + ~BasicString(); + + // accessors + // just get the string + operator BSTR() const { return m_wzBuf; } + // retrieve a copy of our string - caller must SysFreeString() it later! + BSTR Get() const { return SysAllocString(m_wzBuf); } + +private: + // @@@ not implemented (but should be) + BasicString(const BasicString&); + BasicString& operator=(const BasicString&); + + OLECHAR *m_wzBuf; // actual string +}; + +// Convert variants +static bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) ; +static bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant) ; + // Convert string to Unicode static BSTR ConvertStringToOle(const wxString& str); @@ -484,7 +515,7 @@ bool wxAutomationObject::CreateInstance(const wxString& classId) const } -bool wxAutomationObject::ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) +bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) { ClearVariant(&oleVariant); if (variant.IsNull()) @@ -601,7 +632,7 @@ bool wxAutomationObject::ConvertVariantToOle(const wxVariant& variant, VARIANTAR #define VT_TYPEMASK 0xfff #endif -bool wxAutomationObject::ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant) +bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant) { switch (oleVariant.vt & VT_TYPEMASK) { diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index 43f372295c..d32806d9a0 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -32,15 +32,19 @@ #if defined(__WIN32__) && !defined(__GNUWIN32__) -#include -#include -#include +#include +#include + +#include +#include #ifndef __WIN32__ #include #include #endif +#include + // ---------------------------------------------------------------------------- // functions // ---------------------------------------------------------------------------- diff --git a/src/msw/ole/dropsrc.cpp b/src/msw/ole/dropsrc.cpp index e6955bad07..7a434d08f1 100644 --- a/src/msw/ole/dropsrc.cpp +++ b/src/msw/ole/dropsrc.cpp @@ -33,15 +33,20 @@ #if wxUSE_DRAG_AND_DROP #include -#include #include #include +#include + #ifndef __WIN32__ #include #include #endif +#include + +#include + // ---------------------------------------------------------------------------- // wxIDropSource implementation of IDropSource interface // ---------------------------------------------------------------------------- -- 2.47.2