Подскажите пожалуйста как увидеть результат выполнения функции MyFunc()
Вот полный текст рабочей программы программы.
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
type
TMyFunc = procedure;
var
DLLInstance : THandle;
MyFunc : TMyFunc;
w: integer ;
begin
DLLInstance := LoadLibrary(PChar('mdaq12.dll'));
if (DLLInstance = 0) then begin
MessageDlg('Невозможно загрузить DLL', mtError, [mbOK], 0);
Exit;
end;
try
@MyFunc := GetProcAddress(DLLInstance, '_GetUsbDeviceCount@0');
if Assigned(@MyFunc) then
MyFunc()
else
MessageDlg('Не найдена искомая процедура.', mtError,
[mbOK], 0);
finally
FreeLibrary(DLLInstance);
end;
end;
end.
Админ: Пользуемся тегами для оформления кода!
Функция должна давать количество подключенных устройств, а нечего не отображается