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

Вниз

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

 
Oleg Gashev   (2001-12-15 18:35) [1]

Calling DLLs

Topic group See also

Before you can call routines defined in a DLL, you must import them. This can be done in two ways: by declaring an external procedure or function, or by calling the Windows API directly. Whichever method you use, the routines are not linked to your application until runtime. This means that the DLL need not be present when you compile your program. It also means that there is no compile-time validation of attempts to import a routine.
Object Pascal does not support importing of variables from DLLs.

Static loading

The simplest way to import a procedure or function is to declare it using the external directive. For example,

procedure DoSomething; external "MYLIB.DLL";

If you include this declaration in a program, MYLIB.DLL is loaded once, when the program starts. Throughout execution of the program, the identifier DoSomething always refers to the same entry point in the same DLL.
Declarations of imported routines can be placed directly in the program or unit where they are called. To simplify maintenance, however, you can collect external declarations into a separate “import unit” that also contains any constants and types required for interfacing with the DLL. (Delphi’s Windows unit is a good example.) Other modules that use the import unit can call any routines declared in it.

For more information about external declarations, see External declarations .
Dynamic loading through Windows API calls.




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

Форум: "Основная";
Текущий архив: 2002.01.08;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.006 c
14-22401
wHammer
2001-11-09 12:56
2002.01.08
Вот интересно стало?


1-22132
Leviathan
2001-12-19 19:38
2002.01.08
Спрятать форму


4-22473
amamed_3071
2001-11-02 13:46
2002.01.08
Epson Printer commands


1-22077
Art
2001-12-18 17:19
2002.01.08
Вопрос к паскальщикам???


1-22002
BFG
2001-12-16 16:24
2002.01.08
Графики





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский