Главная страница
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.025 c
11-1126546794
Stargazer
2005-09-12 21:39
2006.05.28
TOnMessage в новом KOL


15-1146723086
dolmat
2006-05-04 10:11
2006.05.28
Система не ставится


2-1147233740
Rubey
2006-05-10 08:02
2006.05.28
Имя файла при сохранении


2-1147070660
Dstr
2006-05-08 10:44
2006.05.28
Компеляция ресурсов


15-1146634114
fast2
2006-05-03 09:28
2006.05.28
Как избавится от постоянно всплывающих окон?