From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d2a7ab292898908a X-Google-Attributes: gid103376,public From: tmoran@bix.com (Tom Moran) Subject: Re: Importing calls to access Windows registry Date: 1999/05/07 Message-ID: <37331c0b.1253787@news.pacbell.net>#1/1 X-Deja-AN: 475218145 References: <7gulm9$20b$1@nnrp1.deja.com> X-Complaints-To: abuse@pacbell.net X-Trace: typhoon-sf.snfc21.pbi.net 926096459 207.214.211.61 (Fri, 07 May 1999 10:00:59 PDT) Organization: SBC Internet Services NNTP-Posting-Date: Fri, 07 May 1999 10:00:59 PDT Newsgroups: comp.lang.ada Date: 1999-05-07T00:00:00+00:00 List-Id: The immediate answer to your link errors, as pointed out by Sune Falck, is to add advapi32.lib to your link. As a comment, I'd also suggest you can save yourself a lot of typing and probably a lot of grief by using the package Interfaces.C, instead of defining your own "windows_integer_type" etc and using your own code to append nulls to Ada Strings and using System.Address. In Claw we (internally) use RegOpenKeyEx like function Reg_Open_Key_Ex(Key : Claw.Win32.HKey; lpszSubKey: Claw.Win32.Lpcstr; dwReserved: Claw.DWord := 0; samDesired: Key_Access_Options; phkResult: PHKey) return Reg_Error_Code_Type; pragma Import(Stdcall, Reg_Open_Key_Ex, "RegOpenKeyExA"); inside procedure Open (Key : in out Key_Type; Parent : in Key_Type; Name : in String; Access_Capability : in Access_Capabilities := ALLOW_ALL_ACCESS; Creation_Option : Creation_Options := Open_Only); which uses it with C_Name : Interfaces.C.Char_Array := Interfaces.C.To_C(Name, Append_Nul=>True); Handle : aliased Claw.Win32.HKey; ... Result := Reg_Open_Key_Ex(Parent.Handle, C_Name(0)'Unchecked_Access, 0, -- reserved Access_Code(Access_Capability), Handle'Unchecked_Access);