Fixed compilation for when not including <windows.h>

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1599 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1999-02-04 21:12:30 +00:00
parent 45b776d452
commit 17b74d79ad
6 changed files with 56 additions and 46 deletions

View File

@@ -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_

View File

@@ -31,7 +31,7 @@
// Comment this out if you don't mind slower compilation of the wxWindows
// library
#if !defined(__WXMAC__) && !defined(__SALFORDC__)
#include <windows.h>
// #include <windows.h>
#endif
#ifdef GetClassInfo

View File

@@ -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;
}

View File

@@ -29,6 +29,37 @@
#include <math.h>
#include <time.h>
#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)
{

View File

@@ -33,14 +33,18 @@
#if defined(__WIN32__) && !defined(__GNUWIN32__)
#include <wx/log.h>
#include <wx/msw/ole/oleutils.h>
#include <wx/msw/ole/dataobj.h>
#include <windows.h>
#include <oleauto.h>
#ifndef __WIN32__
#include <ole2.h>
#include <olestd.h>
#endif
#include <wx/msw/ole/oleutils.h>
// ----------------------------------------------------------------------------
// functions
// ----------------------------------------------------------------------------

View File

@@ -33,15 +33,20 @@
#if wxUSE_DRAG_AND_DROP
#include <wx/log.h>
#include <wx/msw/ole/oleutils.h>
#include <wx/msw/ole/dataobj.h>
#include <wx/msw/ole/dropsrc.h>
#include <windows.h>
#ifndef __WIN32__
#include <ole2.h>
#include <olestd.h>
#endif
#include <oleauto.h>
#include <wx/msw/ole/oleutils.h>
// ----------------------------------------------------------------------------
// wxIDropSource implementation of IDropSource interface
// ----------------------------------------------------------------------------