Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: cacb on June 26, 2009, 08:12:48 pm

Title: wxWidgets console application wizard?
Post by: cacb on June 26, 2009, 08:12:48 pm
Hi,

I use the wxWidgets wizard in Code::Blocks to create GUI projects and it works fine. But sometimes I need to create a console application (no GUI) but still have wxWidgets support. For example, I need to create a console application using wxFTP, for special purpose FTP tasks.

Is there a wxWidgets console application wizard somewhere? Alternatively, what are the steps I need to perform to create a console application where I can use wxFTP?
Title: Re: wxWidgets console application wizard?
Post by: stahta01 on June 26, 2009, 11:59:08 pm
I do not know of an wizard for wxWidgets console application; just the wxWidgets GUI one.

Might look at the wxWidgets sample/console/console.cpp it contains FTP code in it using the define TEST_FTP to enable it.

Tim S
Title: Re: wxWidgets console application wizard?
Post by: cacb on June 27, 2009, 02:10:51 am
I do not know of an wizard for wxWidgets console application; just the wxWidgets GUI one.

Might look at the wxWidgets sample/console/console.cpp it contains FTP code in it using the define TEST_FTP to enable it.

Tim S

Ok, thanks for that tip. After some struggle and "hand editing" of the Code::Blocks project file, I got it to work. Actually a wxWidgets console wizard would be a good thing and make it simpler. It would set up the wx include paths, libraries and generate the wxInitializer stuff that is needed. Essentially as for a GUI app.

And the FTP sample does not seem to work as written
Code
wxFTP ftp;
ftp.Connect(...);
wxInputStream* in = ftp.GetInputStream(filename);
size_t size = in->GetSize();  // this always returns zero
int size2 = ftp.GetFileSize(filename);  // this works