User forums > Using Code::Blocks

wxWidgets console application wizard?

(1/1)

cacb:
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?

stahta01:
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

cacb:

--- Quote from: 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

--- End quote ---

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

--- End code ---

Navigation

[0] Message Index

Go to full version