News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

wxWidgets console application wizard?

Started by cacb, June 26, 2009, 08:12:48 PM

Previous topic - Next topic

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
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

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

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

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