All Forums
 Microsoft Windows CE
 General CE
 CE 4.1 registry bug
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

wabtec4

59 Posts

Posted - 06 Jan 2005 :  20:11:04  Show Profile  Email Poster
Hello, I assumed that your CE 4.1 for registry setting had bug.

My platform: CE 4.1 on ADS Bitsy board.

Program segment:( set a few registry keys, very straightforward ).

CONST BYTE TestValue[] = "ABC123";
RegSetValueEx(MDCRootKey, L"TestNameSZ", 0, REG_SZ, TestValue, 7 );
RegSetValueEx(MDCRootKey, L"REG_binary", 0, REG_BINARY, TestValue,7);
RegSetValueEx(MDCRootKey,L"ExpandSZ",0,REG_EXPAND_SZ, TestValue,7 );
RegSetValueEx( MDCRootKey, L"None", 0, REG_NONE, TestValue, 7 );

Running result:
I expected to get a value of "ABC123", but I checked with regedit, I saw:
TestNameSZ(REG_SZ): 3 squares
REG_binary(REG_BINARY): "41 42 43 31 32 33 00"
ExpandSZ(REG_EXPAND): 2 squares.
None: "Unknown data type"

No one gave me "ABC123".

Can you tell me what is wrong, how to fix this?
Thanks.
Charlie


wabtec4

59 Posts

Posted - 06 Jan 2005 :  23:18:42  Show Profile  Email Poster
I have found the solution, it's my fault.
change: CONST BYTE TestValue[] = "ABC123";
to: CONST WCHAR TestValue[] = "ABC123";
and cast it to (BYTE* ) in RegSetValueEx function with the size being 14.

Cheers.
Charlie


Edited by akidder 7-Jan-2005: Moved from "CE Downloads and Documents" forum to "General CE".
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000