View Full Version : New home for me!
26 Sep 2006, 08:41
Thanks to Nick and Arno for creating this site - a much needed home for coders who make FS addons. I can already tell I will be here often!
Please let me know if I can contribute in some way and help the cause.
PS> Next build of FS-Blaze is nearly out the door! My first app for FS but not the last!
Welcome! We are all delighted to see skilled developers coming here.
Contribute what you can... even if you think others will already know it!
26 Sep 2006, 13:16
Hi Scott and welcome over here! In my experience the more i find out the more i realize how little I really know
By the way did you solve the localization problem on FS-Blaze?
26 Sep 2006, 21:57
Yes - I ended up using the System.Globalization.CultureInfo.InvariantCulture method and just kept everything in the format on the NOAA website. Not the most elegant, but certainly effective.
The problem I'm currently working through in FS-Blaze is related to Application.Restart - I check my ini file for a build id string. If an old version is detected, the ini is deleted and rebuilt. However, when I call application.restart(), I get three instances of the application respawning - one with the old settings, one with absolutely NO settings, and a third with the new defaults. Everything exits inelegantly at that point (unhandled exceptions)...very odd.
Not critical though. I'll get it done...
27 Sep 2006, 03:31
Hmmm weird - what are you trying to do?
27 Sep 2006, 03:56
damm ini :)
I had a simillar problem and was only to solve it with the use of Configuration.ConfigurationManager
this.Inform.ForeColor = Color.FromName(ConfigurationManager.AppSettings["ButtonTextColor"]);
However had to add te system.configuration in to the references otherwise it assumed the 1.1 assembly :confused:
27 Sep 2006, 09:47
I have been adding so many entries in the .ini file with the newer builds (poor design plan :) ), I put in a routine to detect an old initialization file. I already had a routine that would detect the lack of an ini file (new install) at startup and create a default, so I thought it would work to simply delete the old invalid ini, and restart the application. However, there's a weird interaction with the try/catch block, closing the file stream, and Application.Restart. Somewhere along the way, an unhandled exception (or more) gets thrown (I suspect restart tries to flush the file stream which has already been released?), and several new threads spawn.
Not a problem, I'm reworking the logic, but if there's an opportunity to learn something here, please teach! I'm a novice, learning as I go - I really hope this will be a good place to grow my skill set and actually create some cool utilities as we go.
27 Sep 2006, 10:00
So, let me see if I understand this - you are using an ini file, different versions can have different ini files so if you find the wrong one you correct it and call the program to restart?
I've had this a bunch of times as I am not good at thinking ahead either :o but I never forced the program to re-start - just cleaned up the ini in the load phase and then processed it, but I guess I haven't gotten the problem right in my head yet...
What sort of ini file are you using and how are you handling it? I know that the purists will shout at me but I still use the old MS ini file and invoke calls to the API to read and write it. The more modern way is to use an XML file for application data, and VS2005 provides it's own settings functionality - though I never got that to work properly and hence I am stuck in the stone age when it comes to ini files :)
27 Sep 2006, 11:18
I've gotten XML to work well - I use that in FS-Blaze for compiling the fire scenery. We should talk about that if you need it.
My ini is just a simple text file. Nothing elaborate. I should have used the registry, but I already knew how to do that, I wanted more practice creating and using data files of my own formatting. An exercise really.
The logic you describe is how I'm approaching it now. Check for old version, delete old, create new with defaults, continue...
27 Sep 2006, 11:36
Hi Scott - let us know how it goes...........
vBulletin® v3.8.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.