From 4c3ebca927cea2742ec128c9c3ef3676d1ecae01 Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Sat, 19 Jul 2003 15:05:08 +0000 Subject: [PATCH] Fix some compilation and linking errors in samples. Replace some calls to wxString::getWriteBuffer with wxStringBuffer. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22107 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/process.h | 2 +- include/wx/variant.h | 1 + src/common/utilscmn.cpp | 52 ++++++++++++++++++----------------------- 3 files changed, 25 insertions(+), 30 deletions(-) diff --git a/include/wx/process.h b/include/wx/process.h index aff0984fd7..57d507d49a 100644 --- a/include/wx/process.h +++ b/include/wx/process.h @@ -136,7 +136,7 @@ protected: // ---------------------------------------------------------------------------- BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(wxEVT_END_PROCESS, 440) + DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_BASE, wxEVT_END_PROCESS, 440) END_DECLARE_EVENT_TYPES() class WXDLLIMPEXP_BASE wxProcessEvent : public wxEvent diff --git a/include/wx/variant.h b/include/wx/variant.h index 7dcdc8ae46..eda1afbb89 100644 --- a/include/wx/variant.h +++ b/include/wx/variant.h @@ -19,6 +19,7 @@ #include "wx/defs.h" #include "wx/object.h" #include "wx/string.h" +#include "wx/arrstr.h" #include "wx/list.h" #if wxUSE_DATETIME diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index ff9c48807c..3e96078407 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -123,25 +123,6 @@ copystring (const wxChar *s) #endif // WXWIN_COMPATIBILITY_2_4 -// Id generation -static long wxCurrentId = 100; - -long -wxNewId (void) -{ - return wxCurrentId++; -} - -long -wxGetCurrentId(void) { return wxCurrentId; } - -void -wxRegisterId (long id) -{ - if (id >= wxCurrentId) - wxCurrentId = id + 1; -} - // ---------------------------------------------------------------------------- // String <-> Number conversions (deprecated) // ---------------------------------------------------------------------------- @@ -354,8 +335,7 @@ wxString wxGetUserId() static const int maxLoginLen = 256; // FIXME arbitrary number wxString buf; - bool ok = wxGetUserId(buf.GetWriteBuf(maxLoginLen), maxLoginLen); - buf.UngetWriteBuf(); + bool ok = wxGetUserId(wxStringBuffer(buf, maxLoginLen), maxLoginLen); if ( !ok ) buf.Empty(); @@ -368,8 +348,7 @@ wxString wxGetUserName() static const int maxUserNameLen = 1024; // FIXME arbitrary number wxString buf; - bool ok = wxGetUserName(buf.GetWriteBuf(maxUserNameLen), maxUserNameLen); - buf.UngetWriteBuf(); + bool ok = wxGetUserName(wxStringBuffer(buf, maxUserNameLen), maxUserNameLen); if ( !ok ) buf.Empty(); @@ -382,9 +361,7 @@ wxString wxGetHostName() static const size_t hostnameSize = 257; wxString buf; - bool ok = wxGetHostName(buf.GetWriteBuf(hostnameSize), hostnameSize); - - buf.UngetWriteBuf(); + bool ok = wxGetHostName(wxStringBuffer(buf, hostnameSize), hostnameSize); if ( !ok ) buf.Empty(); @@ -397,9 +374,7 @@ wxString wxGetFullHostName() static const size_t hostnameSize = 257; wxString buf; - bool ok = wxGetFullHostName(buf.GetWriteBuf(hostnameSize), hostnameSize); - - buf.UngetWriteBuf(); + bool ok = wxGetFullHostName(wxStringBuffer(buf, hostnameSize), hostnameSize); if ( !ok ) buf.Empty(); @@ -554,6 +529,25 @@ bool wxYieldIfNeeded() #if wxUSE_GUI +// Id generation +static long wxCurrentId = 100; + +long +wxNewId (void) +{ + return wxCurrentId++; +} + +long +wxGetCurrentId(void) { return wxCurrentId; } + +void +wxRegisterId (long id) +{ + if (id >= wxCurrentId) + wxCurrentId = id + 1; +} + #if wxUSE_MENUS // ---------------------------------------------------------------------------- -- 2.47.2