Author Topic: wxWidgets console application wizard?  (Read 6276 times)

Offline cacb

  • Regular
  • ***
  • Posts: 415
wxWidgets console application wizard?
« 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?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6782
    • My Best Post
Re: wxWidgets console application wizard?
« Reply #1 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
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline cacb

  • Regular
  • ***
  • Posts: 415
Re: wxWidgets console application wizard?
« Reply #2 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: [Select]
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