Thema: Delphi Gigabyte dll functions

Einzelnen Beitrag anzeigen

Benutzerbild von gsh
gsh

Registriert seit: 24. Okt 2004
1.542 Beiträge
 
Delphi XE Architect
 
#4

Re: Gigabyte dll functions

  Alt 11. Aug 2007, 08:12
try it so
Delphi-Quellcode:
function ismotherboard: boolean;
type
  LX_IsGigaMainBoard = function(pIsGigaMainBoard: Pointer): boolean stdcall;
var
  hInstDll: THandle;
  IsGigaMainBoard: LX_IsGigaMainBoard;
  Pfad: AnsiString;
begin

  Pfad := ExtractFilePath(application.ExeName) + 'w83781d.dll';
  if FileExists(Pfad) then
  begin
    hInstDll := LoadLibrary(PChar(Pfad));
    if hInstDll <> 0 then
    try
      IsGigaMainBoard:= GetProcAddress(hInstDll, 'LX_IsGigaMainBoard');
      if Assigned(IsGigaMainBoard) then
      begin
        IsGigaMainBoard(Addr(Result));
      end
      else ShowMessage('Error');
    finally
      FreeLibrary(hInstDll);
    end;
  end;
maybe der is an error while loding the dll

and do you know that this type deklaration is correct?
LX_IsGigaMainBoard = function(pIsGigaMainBoard: Pointer): boolean stdcall;
Alex
"Sage nicht alles, was du weißt, aber wisse alles, was du sagst!" Matthias Claudius
"Wer sich über Kritik ärgert, gibt zu, daß er sie verdient hat." Tacitus
  Mit Zitat antworten Zitat