Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2006.05.28;
Скачать: CL | DM;

Вниз

DLL   Найти похожие ветки 

 
Naduev Aleksei ©   (2006-05-12 23:58) [0]

Подскажите пожалуйста как подключать библиотеки?
как узнать какие используются переменные в них?


 
alex-drob ©   (2006-05-13 00:06) [1]


> Подскажите пожалуйста как подключать библиотеки?

нужно знать какие функции вне есть с параметрами.
из helpa

You can access routines in a library through direct calls to OS library functions, including LoadLibrary, FreeLibrary, and GetProcAddress. In Windows, these functions are declared in Windows.pas; on Linux, they are implemented for compatibility in SysUtils.pas; the actual Linux OS routines are dlopen, dlclose, and dlsym (all declared in libc; see the man pages for more information). In this case, use procedural-type variables to reference the imported routines.

For example, on Windows or Linux:

uses Windows, ...; {On Linux, replace Windows with SysUtils }
type
 TTimeRec = record
   Second: Integer;
   Minute: Integer;
   Hour: Integer;
 end;
 TGetTime = procedure(var Time: TTimeRec);
 THandle = Integer;
var
 Time: TTimeRec;
 Handle: THandle;
 GetTime: TGetTime;
 ...
begin
 Handle := LoadLibrary("libraryname");
 if Handle <> 0 then
 begin
   @GetTime := GetProcAddress(Handle, "GetTime");

   if @GetTime <> nil then
   begin
     GetTime(Time);
     with Time do
       WriteLn("The time is ", Hour, ":", Minute, ":", Second);
   end;
   FreeLibrary(Handle);
 end;
end;

When you import routines this way, the library is not loaded until the code containing the call to LoadLibrary executes. The library is later unloaded by the call to FreeLibrary. This allows you to conserve memory and to run your program even when some of the libraries it uses are not present.



> как узнать какие используются переменные в них?

скорей всего никак. можно узнать какие процедуры и функции в ней есть.


 
TUser ©   (2006-05-13 09:09) [2]

>  как узнать какие используются переменные в них?

Никакие, т.к. в скомпилированном файле уже нет переменных.


 
isasa ©   (2006-05-13 09:30) [3]

Глобальные переменные, объявленные в DLL, недоступны вызывающему модулю.



Страницы: 1 вся ветка

Текущий архив: 2006.05.28;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.06 c
15-1146811361
Rulikkk
2006-05-05 10:42
2006.05.28
Ищу openSource компонент, для отображения блок схем.


3-1144151066
skovorodka
2006-04-04 15:44
2006.05.28
Номера страниц в Rave Report


15-1146662361
Ji
2006-05-03 17:19
2006.05.28
Найти ветку в архиве


1-1145263745
Экспериментатор
2006-04-17 12:49
2006.05.28
Что не так? Выдает Access Violation на 0000 0000


2-1147069409
konischev
2006-05-08 10:23
2006.05.28
О передаче данных из DLL в программу по событию