귀하는 손님 이십니다
로그인
회원가입
  
  델마당 공식 은행계좌
  하나은행 227-910235-83607
  예금주 이상국(운영진)
프로젝트 게시판
투표게시판
델마당소개
기초부터 활용까지! 델파이 교육 - 데브기어
 광고문의 :
媛뺤쥖, 똻, 젙蹂 媛뺤쥖, 똻, 젙蹂 입니다.
글내용 - 媛뺤쥖, 똻, 젙蹂
 꽌濡 떎瑜 뙣궎吏뿉꽌 媛숈 씠由꾩쓽 쑀떅씠 궗슜맆 닔 뾾뒗 씠쑀.
coding
(沅뚯닚샇)
2018-10-09 삤쟾 12:32:18
카테고리: 똻
1297회 조회



등록된 파일이 없습니다.
뙆뒪移 뼵뼱뿉꽌 媛곴린쓽 쑀떅 떎쓬怨 媛숈씠 initialization怨 finalization 꽮뀡쓣 媛吏 닔 엳떎.

unit Unit1;

interface

implementation

var o: TObject;

initialization
  o := TObject.Create;

finalization
  o.Destroy;
end.


媛곴컖쓽 쑀떅뿉 젙쓽릺뼱 엳뒗 initialization怨 finalization 꽮뀡쓽 肄붾뱶뒗 븳踰덉뵫留 떎뻾맂떎.
봽濡쒓렇옩 떆옉븷 븣 initialization 꽮뀡 肄붾뱶 떎뻾. 醫낅즺 쟾뿉 finalization 꽮뀡 肄붾뱶 떎뻾.

떎뻾뙆씪씠 留뚮뱾뼱吏 븣
봽濡쒖젥듃뿉 룷븿맂 쑀떅뱾쓽 initialization怨 finalization 꽮뀡쓽 肄붾뱶媛 One time쑝濡
븳踰덈쭔 떎뻾맆 닔 엳룄濡 븯湲곗쐞빐 而댄뙆씪윭媛 떎뻾 뙆씪 諛붿씠꼫由ъ뿉 Unit Table 옄猷뚭뎄議곕 깮꽦븯怨
궗슜릺뒗 쑀떅뱾쓽 initialization怨 finalization 뿏듃由 二쇱냼뱾씠 뿬湲곗뿉 뱾뼱 媛꾨떎.
洹몃━怨 而댄뙆씪윭뿉 쓽빐꽌 깮꽦맂 Unit Table쓽 initialization怨 finalization 뿏듃由 二쇱냼뒗
쑀떅 뀒씠釉붿뿉 湲곕줉릺뼱 엳뒗 닚꽌濡 RTL쓽 뒪듃 뾽 肄붾뱶뿉 쓽빐꽌 One time쑝濡 떎뻾맂떎.
쑀떅뿉꽌 initialization 삉뒗 finalization 꽮뀡씠 젙쓽릺뼱 엳吏 븡쑝硫 빐떦 뿏듃由ъ뿏
0 媛믪씠 而댄뙆씪윭뿉 쓽빐꽌 湲곕줉맂떎.

諛붿씠꼫由ъ뿉꽌 Unit Table쓣 遺꾩꽍븯硫 궗슜릺뒗 쑀떅쓽 媛닔, 媛곴린 쑀떅뱾쓽 initialization怨 finalization
뿏듃由 二쇱냼룄 븣븘궪 닔 엳떎.

;; 而댄뙆씪맂 봽濡쒓렇옩 諛붿씠꼫由ъ쓽 Unit Table쓽 븳 遺遺...

CODE:0045A218 30 B3 44 00         dd offset @Menus@initialization$qqrv ; Menus::initialization(void)
CODE:0045A21C C0 B2 44 00         dd offset @Menus@Finalization$qqrv ; Menus::Finalization(void)




洹몃윭굹 뙣궎吏씪 寃쎌슦뿉뒗 떎쓬怨 媛숈 臾몄젣媛 諛쒖깮븳떎.

뙣궎吏 A B 媛 엳떎怨 빐 蹂댁옄.

뙣궎吏 A B媛 Contains뿉 媛숈 씠由꾩쓽 Unit1쓣 룷븿븯怨 엳쑝硫 而댄뙆씪 꽦怨듭쟻쑝濡 릺뼱룄
IDE 뿉꽌 뙣궎吏 A瑜 Install 븳 썑뿉, 씠뼱꽌 뙣궎吏 B瑜 Install 븯젮怨 븯硫 媛숈 씠由꾩쓽 쑀떅씠 
議댁옱븳떎硫댁꽌 뿉윭瑜 諛쒖깮떆궓떎.


솢 씠윴 쁽긽씠 씪뼱궇源?

留뚯빟 IDE媛 뿉윭瑜 諛쒖깮떆궎吏 븡怨 뿀슜쓣 븯寃뚮릺硫 떖媛곹븳 臾몄젣媛 씪뼱굹湲 븣臾몄씠떎.

뼱뼡 臾몄젣깘硫
뙣궎吏 A媛 濡쒕뱶맆 븣 Unit1쓽 Initialization 肄붾뱶媛 샇異쒕릺怨
뙣궎吏 B媛 濡쒕뱶맆 븣룄 媛숈 Unit1쓽 Initialization 肄붾뱶媛 以묐났 샇異.

Unit1쓽 Initialization 肄붾뱶媛 One time쑝濡 븳踰덈쭔 샇異쒕릺뼱빞 븯뒗뜲 以묐났빐꽌 떎뻾릺뒗 臾몄젣媛 諛쒖깮.


留뚯빟 뙣궎吏 B뿉꽌 Unit1쓣 Contains 븯吏 븡怨, Unit1쓣 궗슜븯뒗(Contains) 뙣궎吏 A瑜 Requires濡
룷븿뻽떎硫 洹몃븣뒗 臾몄젣媛 諛쒖깮븯吏 븡뒗떎.

Unit1쓽 Initialization 꽮뀡 뙣궎吏 A뿉꽌 븳踰덈쭔 떎뻾릺湲 븣臾몄씠떎.
뙣궎吏뒗 湲곗〈쓽 DLL 援ъ“뿉 Package Info Table 씠 異붽릺뼱 엳뒗 援ъ“씪꽌 뙣궎吏媛 以묐났 궗슜릺뜑씪룄
DLL Reference 移댁슫듃留 利앷릺怨 硫붾え由ъ뿉 以묐났쟻옱 릺吏븡怨 Initialization 룄 븳踰덈쭔 떎뻾 맖.


뜽뙆씠뒗 媛숈 쑀떅쓽 Initialization 꽮뀡씠 以묐났 떎뻾릺吏 紐삵븯룄濡 留됯린쐞빐
湲곗〈쓽 DLL 援ъ“ 쐞뿉 궗슜릺뒗 쑀떅뱾쓽 紐낆꽭媛 룷븿릺룄濡 뙣궎吏 삎떇쓣 留뚮뱾뼱꽌 궗슜븯怨 엳떎.
IDE뿉 而댄룷꼳듃媛 留롮씠 꽕移섎릺뼱 엳쓣 닔濡 IDE媛 泥섎━빐빞 븷 쑀떅뱾쓽 紐낆꽭젙蹂대룄 뜑 而ㅼ寃 맂떎.
뙣궎吏뿉 룷븿맂 쑀떅뱾쓽 紐낆꽭瑜 씠슜빐꽌 媛숈 씠由꾩쓽 쑀떅씠 궗슜릺吏 紐삵븯룄濡 留됱쓬.

뜽뙆씠 뙆뒪移 뼵뼱媛 Initialization怨 Finalization쓽 醫낆냽쟻씤 援ъ“젣븳쓣 媛吏 닔 諛뽰뿉 뾾뒗 寃껋
뙆뒪移쇱 C++怨 떖由 겢옒뒪 뒪뒪濡 constructor瑜 샇異쒗빐꽌 媛앹껜瑜 깮꽦븯뒗 湲곕뒫씠 뾾湲 븣臾몄씠떎.

CClassA a;  // C++뿉꽑 겢옒뒪 뒪뒪濡 깮꽦옄瑜 샇異쒗븯硫댁꽌 씤뒪꽩뒪媛 솢꽦솕 맆 닔 엳吏留

뙆뒪移쇱뿉꽑 紐낆떆쟻쑝濡 깮꽦옄(Create)瑜 샇異쒗빐꽌 臾댁“嫄 옓뿉 硫붾え由щ 븷떦빐꽌 씤뒪꽩뒪媛 
븷떦릺뼱빞留 븿.


而댄뙆씪맂 諛붿씠꼫由ъ뿉꽌 Package Info 뀒씠釉붿쓣 遺꾩꽍븯硫 Contains맂 쑀떅뱾怨 Requires濡 李몄“릺뒗 dcp 
뙆씪뱾쓽 紐⑸줉룄 븣븘궪 닔 엳떎. 뜽뙆씠뿉꽌 dcp 뙆씪 C++濡 鍮꾧탳븯硫 import 씪씠釉뚮윭由 뿭븷쓣
븯湲곕룄 븯怨, 李몄“릺뒗 뙣궎吏쓽 씤꽣꼸 TypeInfo瑜 IDE뿉 젣怨듯븯뒗 뿭븷쓣 븯湲곕룄 븳떎. 

냼뒪肄붾뱶 뾾씠 뙣궎吏 뙆씪怨 dcp 뙆씪留 諛고룷릺뜑씪룄 dcp 뙆씪쓣 씠슜빐꽌 뿭쑝濡 뙣궎吏 뙆씪쓣 遺꾩꽍빐 
궪 닔룄 엳떎. dcp 뒗 而댄뙆씪맂 dcu 뙆씪뱾쓣 dcp 뿤뜑瑜 遺숈뿬꽌 룷븿븯怨 엳뒗 援ъ“씠誘濡.

Object Inspector뿉꽌쓽 Reflection怨 Data Runtime Binding쓣 吏썝븯湲 쐞빐 뜽뙆씠 而댄뙆씪윭뒗 
븘뿰쟻쑝濡 留롮 뼇쓽 뵒뀒씪븳 Extended RTTI 젙蹂대 깮꽦븷 닔 諛뽰뿉 뾾떎. 而댄뙆씪윭뿉 쓽빐 臾댁留됱븯寃 
깮꽦릺뒗 Extended RTTI 궡遺援ъ“瑜 씠슜빐꽌 냼뒪뿉 洹쇱젒븯뒗 닔以쑝濡쒖쓽 由щ쾭뒪 뿏吏땲뼱留곷룄 媛뒫븯떎. 

겢옒뒪뱾쓽 꽕엫, 뙣윴듃 겢옒뒪, 봽濡쒗띁떚, 씠踰ㅽ듃 빖뱾윭, 겢옒뒪 뜲씠 硫ㅻ쾭 諛 븿닔, set 벑쓽 element 
븘뱶 벑쓽 援ъ껜쟻씠怨 뵒뀒씪븳 Extended RTTI 젙蹂닿 깮꽦릺湲 븣臾몄씠떎. 

gcc 媛숈 C++ 而댄뙆씪윭룄 RTTI 젙蹂대 깮꽦븯湲곕룄 븯吏留 냼뒪肄붾뱶뿉꽌 紐낆떆쟻쑝濡 typeid瑜 슂援ы븷 븣留 
洹 遺遺꾩뿉 븳젙릺뼱 깮꽦릺怨, 깮꽦릺뒗 젙蹂대룄 type name 諛뽰뿉 뾾뼱꽌 뵒踰꾧퉭 젙蹂닿 뾾쑝硫 궗떎긽 
냼뒪 닔以쑝濡쒖쓽 由щ쾭뒪 뿏吏땲뼱留곸씠 C++濡 而댄뙆씪맂 諛붿씠꼫由ъ뿉꽌뒗 遺덇뒫 븯떎.

뜽뙆씠 踰꾩쟾씠 삱씪媛 닔濡 떞빞븷 젙蹂닿 留롮븘졇꽌 Extended RTTI 뜲씠뒗 뜑 而ㅼ怨, 떎뻾뙆씪쓽 겕湲곌
而ㅼ룄濡 븯뒗 슂씤씠 릺湲곕룄 븳떎.

씠윴 援ъ“뒗 빐궧뿉 痍⑥빟븳 뜽뙆씠쓽 留뱀젏씠湲곕룄 븯떎.

;; 빐궧뿉 痍⑥빟븳 뜽뙆씠 Extended RTTI 궡遺援ъ“쓽 븳 遺遺...

CODE:0044C101 05 54 46 6F 72 6D                             db 5,'TForm'
CODE:0044C107 00 C0 44 00                                   dd offset _cls_Forms_TForm
CODE:0044C10B 90 BF 44 00                                   dd offset off_44BF90
CODE:0044C10F 5E 00                                         dw 94
CODE:0044C111 05 46 6F 72 6D 73                             db 5,'Forms'
CODE:0044C117 55 00                                         dw 85                   ; PropCount
CODE:0044C119 D4 35 41 00 3C 00 00 FE 54 0D+                dd offset off_4135D4    ; PropType
CODE:0044C119 43 00 01 00 00 00 00 00 00 80+                dd 0FE00003Ch           ; GetProc
CODE:0044C119 00 00 00 80 0D 00 06 41 63 74+                dd offset sub_430D54    ; SetProc
CODE:0044C119 69 6F 6E                                      dd 1                    ; StoredProc
CODE:0044C119                                               dd 80000000h            ; Index
CODE:0044C119                                               dd 80000000h            ; Default
CODE:0044C119                                               dw 0Dh                  ; NameIndex
CODE:0044C119                                               db 6,'Action'           ; Name
CODE:0044C13A 3C D9 42 00 20 02 00 FF 78 22+                dd offset off_42D93C    ; PropType
CODE:0044C13A 45 00 1C 11 45 00 00 00 00 80+                dd 0FF000220h           ; GetProc
CODE:0044C13A 00 00 00 80 0E 00 0D 41 63 74+                dd offset sub_452278    ; SetProc
CODE:0044C13A 69 76 65 43 6F 6E 74 72 6F 6C                 dd offset sub_45111C    ; StoredProc
CODE:0044C13A                                               dd 80000000h            ; Index
CODE:0044C13A                                               dd 80000000h            ; Default
CODE:0044C13A                                               dw 0Eh                  ; NameIndex
CODE:0044C13A                                               db 13,'ActiveControl'   ; Name
CODE:0044C162 88 C0 42 00 5B 00 00 FF 98 0F+                dd offset off_42C088    ; PropType
CODE:0044C162 43 00 01 00 00 00 00 00 00 80+                dd 0FF00005Bh           ; GetProc
CODE:0044C162 00 00 00 00 0F 00 05 41 6C 69+                dd offset sub_430F98    ; SetProc
CODE:0044C162 67 6E                                         dd 1                    ; StoredProc
CODE:0044C162                                               dd 80000000h            ; Index
CODE:0044C162                                               dd 0                    ; Default
CODE:0044C162                                               dw 0Fh                  ; NameIndex
CODE:0044C162                                               db 5,'Align'            ; Name
CODE:0044C182 00 10 40 00 E0 02 00 FF 7C 4E+                dd offset off_401000    ; PropType
CODE:0044C182 45 00 01 00 00 00 00 00 00 80+                dd 0FF0002E0h           ; GetProc
CODE:0044C182 00 00 00 00 10 00 0A 41 6C 70+                dd offset sub_454E7C    ; SetProc
CODE:0044C182 68 61 42 6C 65 6E 64                          dd 1                    ; StoredProc

Initialization怨 Finalization 꽮뀡쓣 젙쓽븷吏 븞븷吏뒗 궗슜옄 留덉쓬濡 씠誘濡 븞쟾옣移섎줈
媛숈 씠由꾩쓽 쑀떅씠 궗슜릺吏(Contains) 紐삵븯룄濡 븯뒗 寃껋엫. 뙆뒪移 뼵뼱媛 媛뽮퀬엳뒗 援ъ“쟻씤 臾몄젣瑜 
뵾빐媛湲 쐞븳 씪醫낆쓽 렪踰.


吏덈Ц뿉 삱씪삩 떎쓬 湲쓽 빐寃 諛⑸쾿.

https://www.delmadang.com/community/bbs_view.asp?bbsNo=17&bbsCat=0&indx=455962&page=1


IDE뿉꽌 湲곕낯 꽕젙쑝濡 깮꽦릺뒗 뙣궎吏 봽濡쒖젥듃뒗 뵒뤃듃濡 뙣궎吏 냽꽦씠
'Designtime and runtime' 냽꽦쑝濡 깮꽦맂떎.

Designtime 냽꽦쓣 媛뽮퀬 엳湲 븣臾몄뿉 IDE뿉꽌 Install씠 媛뒫븳 寃껋씠떎.

뙣궎吏 봽濡쒖젥듃 샃뀡뿉꽌 Description --> Usage options 뿉꽌 뙣궎吏 냽꽦쓣
Runtime only 濡 諛붽씀뼱꽌 궗슜븯硫 맂떎.

Runtime 뙣궎吏뒗 Designtime 뙣궎吏 떖由 IDE 뼱뱶젅뒪 怨듦컙뿉 留ㅽ븨(Install)릺吏 븡怨
而댄뙆씪留 빐꽌 궗슜븯硫 맂떎.

吏덈Ц뿉 빐떦븯뒗 뙣궎吏 A B뒗 븯굹쓽 떎뻾 봽濡쒓렇옩뿉꽌 룞떆뿉 궗슜릺吏 븡怨
꽌濡 떎瑜 뵆렖뤌뿉꽌 媛쒕퀎쟻쑝濡 궗슜릺뒗 寃쎌슦씪꽌 뙣궎吏 냽꽦쓣 Runtime only濡 而댄뙆씪 빐꽌 궗슜븯硫
媛숈 씠由꾩쓽 쑀떅쓣 Contains뿉 媛졇룄 긽愿 뾾떎. 蹂꾧컻쓽 뵆젢뤌뿉꽌 룆由쎌쟻씤 Runtime 뙣궎吏濡 궗슜릺뒗
寃쎌슦씠誘濡.