Silver Black 23 Posted March 25, 2023 Hi! I have this declaration: function WinSATGetScore(out Score: TWinSATScore): Boolean; external 'WinSATAPI.dll'; But I get the run-time error "Impossible to find WinSATGetScore entry point procedure in dynamic link library <executable.exe>". What's wrong in the declaration? The DLL is a system one and thus included in my Windows 11 System32 folder. Share this post Link to post
programmerdelphi2k 237 Posted March 25, 2023 I dont know so much about DLL exportations, but many DLL (system) using export the procedure by "name" or "index"... then maybe you can try some like this: Quote function FuncNameXXX( same params type like in DLL procedure): type-resulted; external "DLL-name" name 'name-func-into-DLL' // or ... index Idx-func-into-DLL <--- need see documentation! Share this post Link to post
DelphiUdIT 176 Posted March 25, 2023 10 minutes ago, Silver Black said: Hi! I have this declaration: function WinSATGetScore(out Score: TWinSATScore): Boolean; external 'WinSATAPI.dll'; But I get the run-time error "Impossible to find WinSATGetScore entry point procedure in dynamic link library <executable.exe>". What's wrong in the declaration? The DLL is a system one and thus included in my Windows 11 System32 folder. Win32_WinSAT class Article 12/12/2020 2 minutes to read [Win32_WinSAT may be altered or unavailable for releases after Windows 8.1.] <------------------------------------------- Share this post Link to post
DelphiUdIT 176 Posted March 25, 2023 Is not a normal DLL is a COM object. This is a type library definition (you can make your own with IDE). Bye WINSATLib_TLB.pas Share this post Link to post
Silver Black 23 Posted March 25, 2023 30 minutes ago, DelphiUdIT said: Is not a normal DLL is a COM object. This is a type library definition (you can make your own with IDE). Bye WINSATLib_TLB.pas Great, thanks! Share this post Link to post
Silver Black 23 Posted March 25, 2023 41 minutes ago, DelphiUdIT said: WINSATLib_TLB.pas But did you create this on the fly just now, for me?! How did you do that from the original DLL? Thank you so much mate! Share this post Link to post
DelphiUdIT 176 Posted March 25, 2023 (edited) From the IDE: Bye Edited March 25, 2023 by DelphiUdIT Share this post Link to post
programmerdelphi2k 237 Posted March 25, 2023 (edited) the RAD has a TLibImp exe 32/64 that allow create your TLB in command-line (IDE show dll 32bits). param -P allow create your Delphi Pascal imports RADStudio\11.0\bin64\tlibimp.exe” -P My64bit.DLL Edited March 25, 2023 by programmerdelphi2k Share this post Link to post
Silver Black 23 Posted March 26, 2023 20 hours ago, DelphiUdIT said: From the IDE: I had looked into that, but I wasn't sure, now I saw the registered dll, thank you again. However, I still don't know how to call the function I used to call like this: function WinSATGetScore(out Score: TWinSATScore): Boolean; external 'WinSATAPI.dll'; How the new WINSATLib_TLB.pas unit created from the IDE should help with my problem? Share this post Link to post
DelphiUdIT 176 Posted March 26, 2023 (edited) I don't know nothing about WinSat, but what you knew in the past is different from what it is now. [Win32_WinSAT may be altered or unavailable for releases after Windows 8.1.] <------------------------------------------- THIS DOESN'T EXISTS ANYMORE Look at new TLB that i post and this piece of source ... i hope this can help you. Quote unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, WINSATLib_TLB; type TForm1 = class(TForm) Button1: TButton; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; QueryWSat: TCQueryWinSAT; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var p: WINSAT_ASSESSMENT_STATE; begin if Assigned(QueryWSat) then begin p := QueryWSat.Info.AssessmentState; ShowMessage(floattostr(QueryWSat.Info.GetAssessmentInfo(p).Score)); end; end; procedure TForm1.FormCreate(Sender: TObject); begin QueryWSat := TCQueryWinSAT.Create(self); end; procedure TForm1.FormDestroy(Sender: TObject); begin if Assigned(QueryWSat) then QueryWSat.Free; end; end. WINSATLib_TLB.pas Edited March 26, 2023 by DelphiUdIT Share this post Link to post