More Windows build stuff but it may be a mess

Andrew,  I've made more changes and it FINALLY compiles and runs on Windows.  I can load the TestPlugin and the 'Add TPG' button works but it crashes when I select the resultant 'TPG entry' in the tree on the left.  I can't help thinking that I've made a mess of the TPG plugin classes so please do review the changes and reject them if I've misunderstood.  I can re-work the good from the bad if necessary.