كيفية استخدام تابع ضمن ملف dll
#2
للتوضيح اكثر استخدمت الكود التالي:
PHP كود :
unit Unit1;

interface

uses
  Windows
, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  
Dialogs, StdCtrls;

type
  TForm1 
= class(TForm)
    
Button1: TButton;
    
procedure Button1Click(Sender: TObject);
  private
    { Private 
declarations }
  public
    { Public 
declarations }
  
end;
  function 
SNAPI_Init(hwnd: HWND;var DeviceHandles:  array of Integer; var NumDevices: integer): Integer;external 'SNAPI.dll';

var
  
Form1: TForm1;
implementation

{$R *.dfm}


procedure TForm1.Button1Click(Sender: TObject);
var 
dh : array[0..9] of integer;
    
i,l,n:integer;
    
vm_hWnd :TMessage;
begin
 l
:=0;
 for 
I := 0 to 9 do
 
dh[i] := 0;
 
n:=0;
 
l:= SNAPI_Init(Form1.Handle,dh,n);
end;


end. 
وظهر عندي رسالة خطأ كالأتي:
access violation at address 10004f61 in module 'snapi.dll'. write of address 000000
الرد


الردود في هذا الموضوع
كيفية استخدام تابع ضمن ملف dll - بواسطة hytham100sy - 03-09-2013, 10:18 PM

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم