Главная страница
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.026 c
2-1147260862
daimyo
2006-05-10 15:34
2006.05.28
DBMS_SQL


15-1146660132
Гарик
2006-05-03 16:42
2006.05.28
Подлодка "Красный Октябрь"


15-1146391816
Mozart
2006-04-30 14:10
2006.05.28
купил Samsung E820


3-1144153515
RomanH
2006-04-04 16:25
2006.05.28
Обновление данных


9-1130775926
01e9
2005-10-31 19:25
2006.05.28
Плз зацените мою игру - cargame.nm.ru (delphiX)