Главная страница
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.036 c
1-1145460535
rantorira
2006-04-19 19:28
2006.05.28
сохранение древовидной структуры данных в файл


1-1145265006
dracula
2006-04-17 13:10
2006.05.28
Есть две программы, надо из одной в другую передать строку?


1-1145284839
Alexandr55
2006-04-17 18:40
2006.05.28
обработка клика на динамическом объекте


15-1146592419
Новичоккк
2006-05-02 21:53
2006.05.28
Вопрос по HTML


9-1130954045
Yegorchic
2005-11-02 20:54
2006.05.28
Просмотр определённых 3D файлов в GLScene