dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [DotGNU]PInvoke question...


From: Mark Easton
Subject: RE: [DotGNU]PInvoke question...
Date: Thu, 10 Jul 2003 00:41:19 +0100

I'm glad I'm not going totally insane - Gopal almost had me thinking it
was time to ditch coding and try something easier... like undergoing a
species change op and becoming a cat.

>It won't in this case, by design.  The registry code probes the
underlying >OS to see if it is Win32.  It is is, then it will use the
Win32 registry 
>routines.  Otherwise it will use a fake registry implementation to fool
>dumb Windows programs.

I've been looking at the IsWin32 member and it seems to be responsible
for catching the MissingMethodException.  Wouldn't it be better to throw
the exception and be damned, or is that what you were insinuating in
your mail?

>This is supposed to be transparent, but the method that I chose has the

>side-effect of printing out a low-level debug message.  I will change
it to 
>detect Win32 in a different way so that the message doesn't appear.

For me it seems that the exception has to be thrown, otherwise there
will have no sensible way to know that the registry code is not
functioning.  Once again, I'm not sure if you were saying you would
change it to throw the exception, or rather change it not to printf the
current message

>Anyway, don't use the registry to store or retrieve settings.  The API
is 
>provided for legacy code only.  Use a flat text or XML file instead.

My questions are all academic and I'm not considering using the registry
(which I've hated with a passion since Win95), but rather I'm just
working on some training material for Windows developers.

Cheers for all the help,

M




reply via email to

[Prev in Thread] Current Thread [Next in Thread]