Wednesday, May 25, 2011

Java 'Truncated class file' error

When developing an Android app with SpringTools I came across this error - 'Truncated class file'.

I'm not sure what causes this error - if you come across it, try re-installing SpringTools.

Friday, February 11, 2011

<command-line>: error: missing '(' after predicate

Come across this error?
<command-line>: error: missing '(' after predicate
I'm assuming this could be caused by several things, but in my case it was a simple typo with my link options. If you come across this error, double check your options.
g++ -Wall -shared -shared-libgcc -x c++ test.cpp -o bla.exe -AFW2 -Wl,--enable-runtime-pseudo-reloc -Wl,--export-all-symbols
Notice the highlighted above - I forgot the 'l'. It should be -lAFW2

Sunday, February 6, 2011

jQuery Slide Plugin

jQuery has many great plug-ins - the jQuery Cycle Plugin is one of my favs. It produces slideshows with a good range of transition effects and many options. Creating simple slideshows - with a great deal of customization - could not be any easier! =)

Check it out here - http://jquery.malsup.com/cycle/

jQuery

Big fan of jQuery... future post here about why I love it..

Friday, February 4, 2011

Pet of the Month

Cuba is PETstock's January Pet of the Month! =)



"Cuba loves ripping up toys and loves playing at the beach. He also loves his owners who adopted him from the RSPCA."

Wednesday, September 15, 2010

Tab control with Dialogs as Tab pages

When creating a Tab control, it is common to create a dialog for each tab page, and attach them as children of the Tab control. Doing so can cause your app to enter an infinite loop, causing it to hang.

Creates a dialog with hTab (the Tab control) as it's parent.

A workaround is to make the tab pages (dialogs) children of the main window - not the Tab control. You will have to set the Z-order of the tab pages correctly.

Here is an example of a Tab control with dialogs as tag pages:


Not receiving LVN_GETDISPINFO

Often when using a virtual ListView control, the LVN_GETDISPINFO notification will not be received.
Here are some of the reasons why, that I've come across in the past:
  • Forgot to set the LVS_OWNERDATA style. LVS_OWNERDATA is needed for a virtual ListView.

  • Waiting on LVN_GETDISPINFO notification from the wrong parent. The LVN_GETDISPINFO notification is sent to the parent of the ListView control. Eg, If the ListView control is within a Tab control, be sure to handle the LVN_GETDISPINFO notification within the Tab's window procedure, or forward the message on.

  • Forgot to set item count. You must let the ListView control know how many items there are by calling ListView_SetItemCount.

  • Another problem I have come across is when creating a virtual ListView control within a Dialog that was created with CreateWindow (with the WC_DIALOG style).  I found that when creating a dialog with CreateDialogIndirect instead, LVN_GETDISPINFO will work.
 
Copyright 2010 Damien Irving