From: Dave Thomas Date: 2000-10-27T01:25:13+09:00 Subject: [ruby-talk:5872] Weird Win32API problem This is probably a no-brainer to folks who mess about on Windows every day, but it has me stumped... We have some code (part of the installer) that updates the registry: result = RegCreateKey.call(top, subkey, 0, keyClass, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, retSecurity, retHandle, retResult) Where RegCreateKey = Win32API.new("advapi32", "RegCreateKeyEx", ['i','p','i','p','i','i','p','p','p'],'i') This works fine in isolation. However, if before calling tihs code we call the following routine: def log(*msg) File.open($logfile, "a+") {|f| f.puts *msg} end Then the RegCreateKey fails, saying it was passed an invalid parameter. It's the open, not the puts, that seems to be causing the problem. Does anyone have any ideas? Are there any linkages between opening files are playing with the registry? Thanks Dave