Click here to Skip to main content
14,272,402 members
   

Delphi

 
AnswerRe: chang form Pin
smags1314-Mar-14 19:52
membersmags1314-Mar-14 19:52 
GeneralRe: chang form Pin
fatemehsoleimani6-Oct-14 3:40
memberfatemehsoleimani6-Oct-14 3:40 
Question.Net Com Class Callback to Delphi Pin
P1kfr1k9-Oct-13 1:35
memberP1kfr1k9-Oct-13 1:35 
AnswerRe: .Net Com Class Callback to Delphi Pin
smags1311-Oct-13 7:55
membersmags1311-Oct-13 7:55 
QuestionXE4 FMX.TCanvas.DrawLine Pin
Black68cougar28-Aug-13 18:12
memberBlack68cougar28-Aug-13 18:12 
QuestionLoad Class in TypeLibrary Dynamically Pin
Django_Untaken16-Aug-13 0:39
memberDjango_Untaken16-Aug-13 0:39 
QuestionGet CPU Usage Using PDH API Pin
Django_Untaken18-Jul-13 18:38
memberDjango_Untaken18-Jul-13 18:38 
AnswerRe: Get CPU Usage Using PDH API Pin
smags1326-Jul-13 20:59
membersmags1326-Jul-13 20:59 
Not sure your compiler is able to delay load dynamic library[^] which is another option. I haven't got chance to use this syntax though...

I would use the following to dynamically load the function.

type
//definition is based on  http://gr32ex.googlecode.com/svn/trunk/GR32Ex/Examples/DesktopSnow/GPSysHook/api/JwaPdh.pas
  PDH_HQUERY = THANDLE;
  PDH_STATUS = DWORD;
  FuncPdhOpenQuery = function(szDataSource: LPCTSTR; dwUserData: DWORD_PTR;
  var phQuery: PDH_HQUERY): PDH_STATUS; stdcall;

//and your function implementation would be:
procedure LoadPDHQuery;
var
  PdhOpenQuery: FuncPdhOpenQuery;
  DllHandle: HModule;
  QueryHandle: PDH_HQUERY;
  Res: PDH_STATUS;
begin
  try
    DllHandle:= LoadLibrary('pdh.dll');
    if DllHandle > 0 then
    begin
      @PdhOpenQuery:= GetProcAddress(DllHandle, 'PdhOpenQueryW');//notice it's either W or A as stated in MSDN (http://msdn.microsoft.com/en-us/library/windows/desktop/aa372652(v=vs.85).aspx)
      if (Assigned(PdhOpenQuery)) then
      begin
        Res:= PdhOpenQuery(nil, 0, QueryHandle);
      
        ShowMessage(IntToStr(Res));
      
      end;
    end;
  finally
    if (DllHandle > 0)
      FreeLibrary(DllHandle);
  end;
end;

AnswerRe: Get CPU Usage Using PDH API Pin
Jose A Pascoa29-Jul-13 7:01
memberJose A Pascoa29-Jul-13 7:01 
QuestionModify TypeLibrary (Default Location and Contents) Pin
AmbiguousName15-Jul-13 19:19
memberAmbiguousName15-Jul-13 19:19 
AnswerRe: Modify TypeLibrary (Default Location and Contents) Pin
Richard MacCutchan15-Jul-13 22:06
protectorRichard MacCutchan15-Jul-13 22:06 
QuestionConvert delphi 2007 project to latest delphi XE4? Pin
nel7son8-Jul-13 23:34
membernel7son8-Jul-13 23:34 
QuestionRe: Convert delphi 2007 project to latest delphi XE4? Pin
smags139-Jul-13 12:04
membersmags139-Jul-13 12:04 
Question[SOLVED] Not Updating TObjectDictionary Value Correctly Pin
AmbiguousName8-Jul-13 0:42
memberAmbiguousName8-Jul-13 0:42 
AnswerRe: Not Updating TObjectDictionary Value Correctly Pin
smags138-Jul-13 9:22
membersmags138-Jul-13 9:22 
Question[SOLVED] Assigning Properties and Events At Runtime Pin
AmbiguousName28-Jun-13 1:25
memberAmbiguousName28-Jun-13 1:25 
AnswerRe: Assigning Properties and Events At Runtime Pin
smags1328-Jun-13 9:22
membersmags1328-Jun-13 9:22 
QuestionMessage Closed Pin
20-Jun-13 23:25
membermark32220-Jun-13 23:25 
AnswerRe: What is Delphi Pin
Richard MacCutchan21-Jun-13 2:16
protectorRichard MacCutchan21-Jun-13 2:16 
AnswerRe: What is Delphi Pin
Jose A Pascoa29-Jul-13 6:58
memberJose A Pascoa29-Jul-13 6:58 
Question[SOLVED] Access a const from a class Pin
AmbiguousName12-Jun-13 21:30
memberAmbiguousName12-Jun-13 21:30 
AnswerRe: Access a const from a class Pin
Corinna John14-Jun-13 3:01
memberCorinna John14-Jun-13 3:01 
AnswerRe: Access a const from a class Pin
smags1318-Jun-13 8:10
membersmags1318-Jun-13 8:10 
GeneralRe: Access a const from a class Pin
AmbiguousName19-Jun-13 18:47
memberAmbiguousName19-Jun-13 18:47 
GeneralRe: Access a const from a class Pin
smags1320-Jun-13 7:10
membersmags1320-Jun-13 7:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.