Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.01.08;
Скачать: CL | DM;

Вниз

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;
Скачать: CL | DM;

Наверх




Память: 0.46 MB
Время: 0.016 c
7-22437
Paradox
2001-09-25 18:48
2002.01.08
wav


1-22247
som
2001-12-17 11:29
2002.01.08
Помогите кто может.....


14-22388
Merlin
2001-11-08 11:43
2002.01.08
Очередная грязь в кладовке


3-21976
Termik
2001-12-06 11:47
2002.01.08
Хранимые процедуры, динамические статементы


1-22167
Art
2001-12-15 20:56
2002.01.08
Такая вот задачка!!!