miere43 / nim-registry

Deal with Windows Registry from Nim
http://miere.ru/docs/registry/
MIT License
29 stars 5 forks source link

2147483648 can't be converted to RegHandle? #7

Closed ghost closed 2 years ago

ghost commented 5 years ago

when i compile, there raises an error:

C:\Users\Administrator\.nimble\pkgs\winregistry-0.2.0\winregistry.nim(73, 45) Error: 2147483648 can't be converted to RegHandle

2147483648 means HKEY_CLASSES_ROOT, but I only use HKEY_CURRENT_USER

so, it seems like there are some errors in type RegHandle?

azlan commented 5 years ago

You are getting this error when compiling for 32 bit arch. The workaround is to use uint instead of HANDLE: https://github.com/miere43/nim-registry/blob/devel/winregistry.nim#L7

Araq is using uint here, https://github.com/nim-lang/Nim/blob/devel/lib/windows/registry.nim#L15

miere43 commented 2 years ago

Fixed in https://github.com/miere43/nim-registry/pull/8.