Главная страница
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.02 c
1-22025
-=DeD=-
2001-12-18 11:20
2002.01.08
Установка ActiveX


1-22214
T2
2001-12-16 07:15
2002.01.08
BMP 2 RichEdit


3-21905
nic406
2001-11-28 04:21
2002.01.08
Help! Делаю Select * From T1 -> refresh -> ошибка(ADODataSet)


14-22414
wHammer
2001-11-12 10:48
2002.01.08
Delphi 5 and(or(xor)) C++ Builder 5?


14-22380
Бармен
2001-11-09 10:37
2002.01.08
Москвичи, кто-нибудь видел в продаже справочник по Win API?