wxFFileOutputStream usage under GTK

Igor Korot ikorot at earthlink.net
Wed Apr 2 14:49:38 PDT 2008


Vadim,

-----Original Message-----
>From: Vadim Zeitlin <vadim at wxwidgets.org>
>Sent: Apr 2, 2008 5:28 PM
>To: wx-users at lists.wxwidgets.org
>Subject: Re: wxFFileOutputStream usage under GTK
>
>On Wed, 2 Apr 2008 16:19:22 -0400 (EDT) Igor Korot <ikorot at earthlink.net> wrote:
>
>IK> Hi, ALL,
>IK> Consider the following code snippet:
>IK> 
>IK> class MyClass
>IK> {
>IK> public:
>IK>     MyClass();
>IK>     ~MyClass();
>IK> #if wxUSE_STD_IOSTREAM
>IK>   wxSTD ostream& SaveObject(wxSTD ostream& text_stream);
>IK>   wxSTD istream& LoadObject(wxSTD istream& text_stream);
>IK> #else
>IK>   wxOutputStream& SaveObject(wxOutputStream& stream);
>IK>   wxInputStream& LoadObject(wxInputStream& stream);
>IK> #endif
>IK> 
>IK> private:
>IK> // Some member data
>IK> };
>IK> 
>IK> void MyFrame::ProcessAndSaveObject()
>IK> {
>IK>    MyClass A;
>IK>    // some processing
>IK>    wxFFileOutputStream stream( fileName );
>IK>    A.SaveObject( stream );
>IK> }
>IK> 
>IK> This code compiles and works on wxMSW. However it fails to
>IK> compile on wxGTK-2.8, saying that there is no function to
>IK> call for A.SaveObject(wxFFileOutputStream).
>IK> 
>IK> What do I need in order to compile this code across platform?
>
> Either build wxGTK without wxUSE_STD_IOSTREAM or write your code without
>this #if -- why did you add it?

Docvwmdi sample is written this way.

>
> Regards,
>VZ

Thank you.

>
>-- 
>TT-Solutions: wxWidgets consultancy and technical support
>               http://www.tt-solutions.com/
>
>_______________________________________________
>wx-users mailing list
>wx-users at lists.wxwidgets.org
>http://lists.wxwidgets.org/mailman/listinfo/wx-users



More information about the wx-users mailing list