Tuesday, December 14, 2010

wxDateTime::Format() blows

Was getting crashes, of all things, on my call to wxDateTime::Format. The problem turned out to be that where I should have used %S for seconds, I had used %s. This should not be a compiles-fine-but-crashes issue!!!

Making lemonade after lemons, here are a couple of nice pages that I found along the way to figuring this out:

The most examples ever for wxDateTime::Format on a single web page:

http://forums.codeblocks.org/index.php?topic=1587.0

The "Hello World" example in the following verified that when I was building my file name for the dialog box I was using %s correctly:

http://biolpc22.york.ac.uk/wx/docs/html/wx/wx_wxstringoverview.html

However, I was possibly using a wxString incorrectly instead of wxString.c_str() for the source of my %s.

Here is the big table of all the time formatting controls:

http://www.cplusplus.com/reference/clibrary/ctime/strftime/

Here are a few doc pages for the wxWidgets time classes, which are very interesting and full-featured:

http://docs.wxwidgets.org/2.9/overview_datetime.html

http://docs.wxwidgets.org/2.9/classwx_date_time.html

The wxWiki page of file dialogs for babies:

http://wiki.wxwidgets.org/Writing_Your_First_Application-Common_Dialogs

The docs page for file dialogs, for which the examples are pretty weak:

http://docs.wxwidgets.org/trunk/classwx_file_dialog.html