![]() |
WinSAT
Hello!
I am asking becouse there isnt no examples in delphi if there were i wouldnt even ask.. I am using win 7 so i decided to add WinSAT ability to my program so i found this example on MSDN.But its really confusing i c/c++ or c# dont really now.Could someone explain it to me what it does. i installed winsat library via type import in delphi 2009.So i thought it was easy to do i decided to give it a try....
Delphi-Quellcode:
)
CInitiateWinSAT1.Create(SELF);
CInitiateWinSAT1.DefaultInterface.InitiateFormalAssessment({what goes in here delphi says a constant wich constant!},nil Zitat:
[quote] |
Re: WinSAT
Liste der Anhänge anzeigen (Anzahl: 1)
Some progress i also included the pass file for other to see if it works.WIN7/VISTA is a must to test this.
This hopfully will start the winsat routine.
Delphi-Quellcode:
Good news Leute this works as it turns off Aero and writes XML to the system. :bounce1:
procedure TForm1.Button1Click(Sender: TObject);
var i:IWinSATInitiateEvents; k:_RemotableHandle; l:hresult; s:string; begin CInitiateWinSAT1.Create(SELF); CInitiateWinSAT1.DefaultInterface.InitiateFormalAssessment( i,k) ; i.WinSATComplete(l,pchar(s)); end; [edit=mkinzler]Delphi-Tag eingefügt Mfg, mkinzler[/edit] |
Re: WinSAT
Why turning off Aero?
|
Re: WinSAT
Well you know when you start WinSAT or Perfomance Index crap it turns it off to analyze your system if its compatible:P
It stops at that line wich is comented why is that widestring > pchar or what?
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var i:IWinSATInitiateEvents; k:_RemotableHandle; v:integer; s:widestring; begin CInitiateWinSAT1.Create(SELF); CInitiateWinSAT1.DefaultInterface.InitiateFormalAssessment( i,k) ; i.WinSATComplete(v,pchar(s)); //<here it stops and why? WINSAT_STATUS_COMPLETED_SUCCESS 0x40033 if v=$40033 then showmessage('no'); end; |
Re: WinSAT
Use String instead of WideString
|
Re: WinSAT
Yes but it still holds.It only stops at the line when i try to check for status did it pass or fail.
![]() |
Re: WinSAT
Delphi-Quellcode:
CInitiateWinSAT1 := CoCInitiateWinSAT.Create;
|
Re: WinSAT
Gives the same result as mine.But it works it functions.But the checking procedure fails.If i want to check for the STATUS.
|
Re: WinSAT
Sorry for double post but i think i found the couse.I need only this and then i got it :)
Its bascily a function for tracing the progress and after the progress ends.
Delphi-Quellcode:
// *********************************************************************//
// Interface: IWinSATInitiateEvents // Flags: (0) // GUID: {262A1918-BA0D-41D5-92C2-FAB4633EE74F} // *********************************************************************// IWinSATInitiateEvents = interface(IUnknown) ['{262A1918-BA0D-41D5-92C2-FAB4633EE74F}'] function WinSATComplete(hresult: HResult; strDescription: PWideChar): HResult; stdcall; function WinSATUpdate(uCurrentTick: SYSUINT; uTickTotal: SYSUINT; strCurrentState: PWideChar): HResult; stdcall; end;
Delphi-Quellcode:
var
i:IWinSATInitiateEvents; k:_RemotableHandle; q:CoCInitiateWinSAT ; v:integer; s:string; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin CInitiateWinSAT1.Create(self); CInitiateWinSAT1.DefaultInterface.InitiateFormalAssessment( i,k) ; end; procedure TForm1.Timer1Timer(Sender: TObject); var itotal,icurrent:integer; sa:string; begin i.WinSATUpdate(icurrent,itotal,pchar(sa)) ; //CODE HALTS HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! if itotal>0 then progressbar1.Position:=100*icurrent div itotal; end; end; |
Re: WinSAT
@Razor: Remember, you can edit a post for 24 hours!
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:14 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz