AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

WinSAT

Ein Thema von Razor · begonnen am 5. Okt 2009 · letzter Beitrag vom 7. Okt 2009
 
Razor
(Gast)

n/a Beiträge
 
#12

Re: WinSAT

  Alt 6. Okt 2009, 11:48
bump.

Could someobody translate this. in to delphi?

C++ Code
Delphi-Quellcode:
// Class that implements IWinSATInitiateEvents. Implement this class to
// get progress information and completion notification.
class CWinSATCallbacks : public IWinSATInitiateEvents
{
    LONG m_lRefCount;

public:

    // Constructor, Destructor
    CWinSATCallbacks() {m_lRefCount = 1;}
;
    ~CWinSATCallbacks() {};

    // IUnknown methods
    HRESULT __stdcall QueryInterface(REFIID riid, LPVOID *ppvObj);
    ULONG __stdcall AddRef();
    ULONG __stdcall Release();

    // IWinSATInitiateEvents methods
    HRESULT __stdcall WinSATComplete(HRESULT hr, LPCWSTR description);
    HRESULT __stdcall WinSATUpdate(UINT currentTick, UINT tickTotal, LPCWSTR currentState); //how to use this ?
};

Delphi Code

Delphi-Quellcode:
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;
Example in c++ code

Delphi-Quellcode:
// Is called when the assessment makes progress. Indicates the percentage of the assessment
// that is complete and the current component being assessed.
HRESULT CWinSATCallbacks::WinSATUpdate(UINT currentTick, UINT tickTotal, LPCWSTR currentState)
{
    // Typically, you would provide the tick values to a ProgressBar control.

    if (tickTotal > 0)
    {
        wprintf(L"\n*** Percent complete: %u%%\n", 100*currentTick/tickTotal);
        wprintf(L"*** Currently assessing: %s\n\n", currentState);
    }


    return S_OK;
}

So acording to the above code why does the compiler halt when i press on the button?

Delphi-Quellcode:
i:IWinSATInitiateEvents;
  k:_RemotableHandle;
  l:hresult;
  s:string;
begin
  CInitiateWinSAT1.Create(SELF);
 
  i.WinSATComplete(l,pchar(s)); //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 14: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