www.digitalmars.com         C & C++   DMDScript  

c++.stlsoft - basic_reg_key_sequence

reply Allan_McLellan interconsecurity.com writes:
I was wondering why 'basic_reg_key_sequence' does not have a member function to
access the key's handle.  I would have wanted such a member function to
determine if the key was opened successfully. Or is there some other way to
check for a failure to open the key.

Thanks

Allan McLellan
May 18 2006
parent "Matthew" <nowhere noaddress.co.us> writes:
Hi Allan

I was wondering why 'basic_reg_key_sequence' does not have a member 
function to
 access the key's handle.  I would have wanted such a member function to
 determine if the key was opened successfully. Or is there some other way 
 to
 check for a failure to open the key.
When compiling with exception support, failure to open a key is indicated by the throwing of an instance of registry_exception. But you're correct that there is no unambiguous way to determine whether key opening is successful when compiling without exception support: a non-0 return from empty() might as well indicate a successfully opened key with no elements. So, I've just amended it to add the get_key_handle() and get() methods. However, in doing so, I've realised that in some of the cases where an exception is thrown the associated error code (available via windows_exception::get_error_code()) will be 0, since they are assigned from GetLastError() and the registry functions don't (always) affect the thread error code. Hence, I should really do some further amendments to ensure that full information is available in all cases of thrown exception. I'm way behind in releasing the next 1.9 beta, but I'll try and make all these registry changes in the next couple of days and released a next beta. In the meanwhile I'm including the updated winstl/registry/reg_key_sequence.hpp. (This assumes you've downloaded and are using 1.9 beta 5, of course.) Please let me know how you go. Cheers Matthew begin 666 reg_key_sequence.zip M92YH<'#L M/CMU/7[$9+MW_2CV#D-^ZT9Q^( ?[#O^8$?\[TONCWESMEBPVC0(YSST'F1W M.]^KCJ )_.4R7 21Q- *_-B!,2R><39R(G><&\MB/E]X3LS9V'.BJ,$<?\*, M[L B:)F&=ZY\=QQ,.(L6?.PZGALYL1L(!"$/ILV$CFX0\TCQ.03T0>C>NK[C M,1?P\3D'RG H"Z9$'6%G,V="W]R8ATX<A,5$?'*\);?CAP5G3L1\'L5\( #P M'.$C;7FJ2B9?2!T \G#J "(EI+1"#O M8K+2Y<*AVS\D4,Z!OD379W&\.#H M6_!P[L8XM: <G]P)1^UU8E+A:>!YP3W.U#CP)ZXP$QPTY_%10MK!"G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