GHI BootLoader BIG flaw

I got an exception while trying to connect to the Domino :frowning:

I changed this line in frmConnect.cs :

string lastPort = Application.UserAppDataRegistry.GetValue("LastPort", null).ToString();

to

string lastPort = (string)Application.UserAppDataRegistry.GetValue("LastPort", null);

and it works now.

FWIW…

Edit: to me, this happens because the registry key was not found the first time.
Another workaround could be the manual insertion of the following key in the registry before the first use of FEZPanel :


"GHISDKFolder"="the local folder that contains the GHI SDK : C:\\Documents and Settings\\bla-bla"
"LastPort"="COM3"

Btw, I have a suggestion for FEZPanel : why not stop using the registry ? :-[
There can be many potential problems with it, mainly because of (missing) rights or so.

There can be other ways to bypass it :

  • use of .ini file in the app directory
  • use of application.settings in VS

Given the “simplicity” of the program, I would tend to use the first one (.ini file). If multi-users usage with different parameters for each of them, then I would go with settings, though it can still be used by a lonely user too :hand:

What do you think ?

I watch a lot of the videos on channel9.msdn.com, one of my favorite was from the guy who team invented COM, OLE and the registry. A few years later he gave a presentation and when he got to the sections about the registry his power point slide filled up with " I’m sorry! " over and over. :wink: It had not taken him too long to realize how the registry would be abused and look at the bloated registry monsters we all have now.

If I had my 'druthers*, I would suggest using a simple XML file to hold configuration settings. Not only does it have the advantage of not adding more clutter to the registry but it also allows you to transfer your settings from one computer to another. The tricky part about this is where to store the file to avoid access problems. My first suggestion would C:\Users\username\AppData. It is just a thought.

  • my 'druthers == the way I would rather so something

just use app config, it’s easier to access in code too :wink:

That got fixed last night when we were testing with terrorgen on his Domino :slight_smile: If you’ve started Panel again since then it will tell you about a new update. I also updated the source code thats on my site to reflect this as well.

So, forget my fix :wink:

Other idea still alive, though… And others also have good ideas about this :stuck_out_tongue: