Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Начинающим";
Текущий архив: 2006.05.28;
Скачать: [xml.tar.bz2];

Вниз

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;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.012 c
15-1146599729
SergP
2006-05-02 23:55
2006.05.28
asm


15-1146170587
Commerce
2006-04-28 00:43
2006.05.28
ShareWare


15-1146261312
lookin
2006-04-29 01:55
2006.05.28
Skype никто не желает?


6-1138086770
clickmaker
2006-01-24 10:12
2006.05.28
Indy 10 - IdFtp - HTTP Proxy with FTP support


2-1147166724
seleman
2006-05-09 13:25
2006.05.28
xpmanifest





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский