Вниз
Скачать: CL | DM;

ExitProc в Library   Найти похожие ветки 

 
MDL   (2003-08-13 15:24) [0]

Подскажите, пожалуйста, почему не выполняется код процедуры MyExitProc в Dll:

library Test;

var
SaveExit: Pointer;

procedure MyExitProc;
begin
ShowMessage("ExitProc executed"); // не работает
ExitProc := SaveExit;
end;

begin
SaveExit := ExitProc;
ExitProc := @MyExitProc;
ShowMessage("Library initialized"); // работает
end.


 
Skier ©   (2003-08-13 15:30) [1]

1)ExitProc is only used when generating .EXE files.
2) Because ExitProc is not compatible with packages, it is not
recommended that you assign a value to ExitProc. Instead,
add code to the finalization section of a unit.


 
Толик ©   (2003-08-13 15:31) [2]

взято из help"а
...ExitProc is only used when generating executable files...


 
MDL   (2003-08-13 15:40) [3]

Тоже взято из help
Topic group:Dynamic-link libraries and packages

...
When a library is unloaded, it’s exit procedures are executed by repeated calls to the address stored in ExitProc, until ExitProc becomes nil.


 
Толик ©   (2003-08-13 16:08) [4]

М-да, и правда, в хелпах ерунда какая-то написана:
Library initialization code:
Library initialization code can also install an exit procedure using the ExitProc variable, as described in Exit procedures; the exit procedure executes when the library is unloaded.
ExitProc variable
ExitProc is only used when generating executable files. Do not use ExitProc within a dynamically loaded package.

Не верь глазам своим...
А вообще-то, я этот вопрос поднимал пару дней назад. Ответ нашёлся у Borlanda: http://community.borland.com/article/0,1410,27753,00.html



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

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.026 c
3-81537
Echelon
2003-07-31 15:48
2003.08.25
Вопрос по Midas


14-81890
Viktor Kushnir
2003-08-08 09:16
2003.08.25
Internet via e-mail


14-81924
ghost_by
2003-08-08 17:35
2003.08.25
DBGrid - несколько вопросов.


4-82004
Mortal
2003-06-22 18:10
2003.08.25
Отловить PopUp


1-81786
Zorik
2003-08-14 10:13
2003.08.25
как отобразить поверхность




   Наверх