Delphi Package ¾Ç²ßµ§°O¡]§t°Q½×«H¥óºëµØ¡^
§@ªÌ: ½²·ØÅï (huanlin_tsai@yahoo.com)
¤é´Á: Mar-29-2000, Sep-3-2001
¦b¹ê§@ package ®É¡A§Ú¹J¨ì¤F¤@¨Ç°ÝÃD¡A©Ó»XDelphiChat¦h¦ì¼ö¤ßªB¤ÍªºÀ°¦£¸Ñ¨M¤p§Ì³\¦hºÃ´b¡A¦]¦¹·í³Å¥S(James
Fu)´£Ä³±N°Q½×«H¥ó¾ã²z¥X¨Ó¨Ã°t¦X½d¨Ò¨Ñ¤j®a°Ñ¦Ò®É¡A§Ú¤]«ÜÃÙ¦P¡A¨Ã¥B±N¥±`ªºµ§°O¤Î½d¨Òµ{¦¡µy§@¾ã²z¤@µf¡A©ó¬O¦³¤F³o¥÷¤å¥ó¡C
¦pªG§A¥¿¦b¦Ò¼{n¤£n±N package
¹ê»Ú¹BÀ³¥Î¦b±M®×¸Ì±¡A§A¥i¥H¥ý¬Ý¬Ý package ªºÀuÂI¤Î¯ÊÂI¡C·Qn¶i¤@¨B¤F¸Ñpackage
¦p¦ó¨Ï¥Î¡A«Øij±z¥ý¾\Ū°Ñ¦Ò¸ê®Æ¸Ì±ªº¤@¨Ç¤å³¹¡AµM«á¤U¸ü½d¨Ò¦Û¤v°Ê¤â°µ¬Ý¬Ý¡C
°Ñ¦Ò¸ê®Æ
¥«±¤W¤w¸g¦³«Ü¦h²{¦¨ªº¸ê·½¡A¥]¬A®ÑÄy¡AÂø»x¡Aºô»Úºô¸ô¤W±³£¦³¤¶²Ð
package ªº°ò¦ª¾ÃÑ¡A©Ò¥H§Ú¨Ã¤£·Q¦b³o¸Ì«½Æ³o¨ÇªF¦è¡A§Ú±N³o¨Ç¸ê·½¦C¥X¨Ó¨Ñ»Ýnªº¤H°Ñ¦Ò¡G
¥H¤W©Ò¦Cªº¸ê·½À³¸Ó¬Û·í°÷¤F¡A¥t¥~§Ú¤]¥Î
Delphi 5 ¼g¤F¤TÓ½d¨Ò¡A¤À§O¬O¡G
¥]§t¤@Ó¥Dµ{¦¡¤Î¨âÓ package
¡AÀ£ÁYÀɤº§t¤l¥Ø¿ý¡AY¥H Pkunzip ¸ÑÀ£ÁY®É½Ð¥[
-d °Ñ¼Æ¡C¨ä¤¤ProjectGroup1.bpg ¥i¥H«Ø¥ß©Ò¦³ªº¼Ò²Õ¡C
PkgDemo1
ªº§ï¶iª©¥»¡AÀ£ÁYÀɤº§t¤l¥Ø¿ý¡AY¥H Pkunzip
¸ÑÀ£ÁY®É½Ð¥[ -d °Ñ¼Æ¡A¸Ñ¶}«á½Ð¥ý¾\Ū¨ä¤¤ªº
Readme.txt¡A¸ÌÀY¦³Â²³æªº»¡©ú¡C
±q³oÓ½d¨ÒÀ³¸Ó¥i¥Hl¥Í¥X§ó½ÆÂøªº¹ê»ÚÀ³¥Î¡A¦pªG¦³¤£¤F¸Ñ¤§³B¡A
§Ú«Øij±z¥ý¬Ý¬Ý James Heyworth
ªº¨º½g¤å³¹¡]¨£¤W¤è°Ñ¦Ò¤åÄm¡^¤Î¨ä½d¨Ò¡C
¦¹½d¨Ò±N DataModule ¤]°µ¦¨¤@Ó¿W¥ßªº package¡A½Ð°Ñ¦Ò
_readme.txt ªº»¡©ú¡C
¥H¤U¬Oºô¤Í´£¨Ñªº½d¨Ò¡G
¥Ü½d¦p¦ó±N DataModule ©ñ¦b package ¤¤Åý¨ä¥Lµ{¦¡¦@¥Î¡C
¥H¤U¬O§Úªºµ§°O¡A¤ñ¸û¤ù¬q¦Ó¯Ê¥F§¹¾ã©Ê¡A¶È¨Ñ°Ñ¦Ò:)
¨Ï¥Î Package ªºÀuÂI
- À³¥Îµ{¦¡¥i¥H³Q°ª«×ªº¼Ò²Õ¤Æ¡A¦Ó¥B¥i¥H³vº¥¥æ¥I§¹¦¨ªº¥\¯àµ¹«È¤á¡C
- ¶}µo¤Hû¥iÀH®É¦]À³¥«³õµ¦²¤¥]¸Ë¦¨¦h¼Ë©Êªº³nÅé¡C
- ºûÅ@¤ñ¸û¤è«K¡C
- ¸`¬Ù°O¾ÐÅé¡A¨Ã¥B´£ª@µ{¦¡¸ü¤Jªº³t«×....¦pªG¨Ï¥Î±o©yªº¸Ü:)¡C
¨Ï¥Î Package ªº¯ÊÂI
¦b±N¼Ò²Õ¿W¥ß¥X¨Óªº¹Lµ{¤¤·|¹J¨ì¦@¨É¥þ°ìÅܼƤΪ«¥óµ¥°ÝÃD¡A»Ýnªá¤ñ¸û¦hªº¤ß«ä¦b¼Ò²Õ¤Æªº³]p¤W±¡AÃö©ó³o¨Ç°ÝÃD¡A¥i¥H°Ñ¦Ò
DelphiChat
°Q½×«H¥óºëµØ ©Î³\¯à±o¨ì¨Ç½u¯Á¡C
¦b¼¶¼g´XÓ package ªº´ú¸Õµ{¦¡¤§«á¡A§ÚÁÙ¬O¨S¦³±N package
À³¥Î¦b¹ê»Úªº±M®×¶}µo¤¤¡A¦Ó¤´µM¨Ï¥Î DLL¡A¨ä³Ì¥Dnªºì¦]¡A¥¿¬O
package Àu©ó DLL
¤§³B¡Ð¡Ð¥i¥H¦@¨ÉÅܼơC³o¶µ¥\¯àªº¥ß·N«Ü¦n¡A¦ý¤]±a¨Ó¤F¥t¤@¨Ç¨î¡A¥Dn¬O¦WºÙ½Ä¬ðªº°ÝÃD¡A¨Ï±o¦@¥Îªº
unit ¤@©wn©ñ¦b package ¸Ì±¡A§_«h·í¨âÓ package ¥]§t¤F¬Û¦Pªº
unit¡A¨ä¤¤¤@Ó´NµLªk¸ü¤J¡A§ÚÌı±o³o·|³y¦¨³Â·Ð¡C¥t¥~¡A¥Ñ©ó¨ä¥Lªº¤p²Õ¦¨û¹ï©ó
package ªº¨Ï¥Î¤£¼ô¡A®e©ö¥X trouble¡]¨Ò¦p¡Gproject n¥[¤J .dcp
¤§Ãþªº¡^¡A³o¤]¬O¦Ò¶q¤§¤@¡C
°ÊºA¸ü¤J package ªº¨ç¦¡¡]SysUtils.pas)
¸ü¤J package ¦ÜÀ³¥Îµ{¦¡ªº°õ¦æªÅ¶¡¡C
¨ç¦¡ì«¬¡Gfunction LoadPackage(const Name: string):
HMODULE;
°Ñ¼Æ Name ¬°±ý¸ü¤Jªº package
ªº§¹¾ã¸ô®|¤ÎÀɮצWºÙ¡C
¶Ç¦^Ȭ°¸ü¤Jªº package ªº Handle¡A¦¹ Handle
¦bÄÀ©ñ package ®É·|¥Î¨ì¡A©Ò¥H¥²¶·¦n¦n«O¦s¡C
¦¹¨ç¦¡·|¥ýÀˬd±ý¸ü¤Jªº package ©Ò¥]§tªº
units ¬O§_¤w¦b¥Ø«e¸ü¤Jªº package
¤¤«½Æ¥X²{¡AYµ{¦¡³æ¤¸«½Æ´N¤£¸ü¤J¥BÅã¥Ü¿ù»~°T®§¡A§_«h·|±N¦¹
package ¤¤©Ò¥]§tªº¦U³æ¤¸ªº Initialization
°Ï¬qªºµ{¦¡½X°õ¦æ¤@¹M¡C½Ðª`·N¡ALoadPackage
·|¥ýÀˬd¸Ó¼Ò²Õ¬O§_¤w¸g¸ü¤J¤F¡A¦pªG¬O¡A´Nª½±µ¶Ç¦^¸Ó¼Ò²ÕªºHandle¡A¨Ã¥B±N¼Ò²Õªº¸ü¤Jp¼Æ¥[¤@¡]increase
reference count¡^¡A¼Ò²Õ¤¤¦U³æ¤¸ªºInitialization
°Ï¬q¤£·|³Q°õ¦æ¡C©Ò¥H§Y¨Ï«½Æªº©I¥s¦¹¨ç¦¡¡A§Ų́䣷|¦bµ{¦¡ªº°õ¦æªÅ¶¡¤¤¾Ö¦³¦hÓ¬Û¦Pªº¼Ò²Õ¡C
¨ç¦¡ì«¬¡Gprocedure UnloadPackage(Module: HMODULE);
¦¹¨ç¦¡·|¥ý±N«ü©wªº package
¼Ò²Õ©Ò¥]§tªº¦U³æ¤¸ªº Finalization
°Ï¬qªºµ{¦¡½X°õ¦æ¤@¹M¡AµM«á¨ø¸ü¸Ó¼Ò²Õ¡C
±q VCL ªºì©l½X SysUtils.pas
¤¤«õ±¸¡A¥i¥Hµo²{¥¦¦¹¨ç¦¡¨Ì§Ç©I¥s¤F
FinalizePackage ¤Î FreeLibrary¡A¨ä¤¤ FinalizePackage
·|¥h°õ¦æ Finalization °Ï¬qªºµ{¦¡½X¡A¦Ó
FreeLibrary ¬O WinAPI¡A¥¦·|¥ý»¼´î¼Ò²Õªº°Ñ¦Òp¼Æ¡A¦pªG°Ñ¦Òp¼Æ¬°¹s¤~·|±N¼Ò²ÕÄÀ©ñ±¼¡C
VCL Ãþ§Oµù¥U¨ç¦¡ (Classes.pas)
- RegisterClass »P RegisterClasses
procedure RegisterClass(AClass: TPersistentClass);
procedure RegisterClasses(AClasses: array of TPersistentClass);
³z¹L¦ê¬y¨t²Î(stream system)µù¥UÃþ§O¡A¤wµù¥U¹LªºÃþ§O¤£·|«½Æµù¥U¡A¦ý¦pªG¬O¤£¦P
package ¦³¬Û¦PªºÃþ§O¦WºÙ¡A«h©I¥s¦¹¨ç¦¡·|¥X²{
EFilerError ªº¿ù»~°T®§¡C¦¹¨ç¦¡³q±`©ñ¦bµ{¦¡ªº
initialization °Ï¬q¡C
³z¹L RegisterClass
µù¥UªºÃþ§O¥i¥H¥Î¦¹¨ç¦¡¨ú±oÃþ§Oªº MetaClass¡A¨ú±o
MetaClass ¤§«á´N¥i¥H¥H¦¹¨Ó«Ø¥ß¸ÓÃþ§Oªºª«¥ó¡C°Ñ¦Ò¤U±ªº½d¨Ò¡]¥H¤U®i¥Üªº¤è¦¡¤£¥u¥i¥H«Ø¥ß
Form ª«¥ó¡Aµy§@קï´N¥i¥H«Ø¥ß¨ä¥Lª«¥ó¡^¡G
function CreateFormByClassName(ClassName: string): integer;
var
AClass: TPersistentClass;
AForm: TCustomForm;
begin
Result := mrNone;
{ Note that TApplication "owns" this form and thus it must
be freed prior to unloading the package }
AClass := GetClass(ClassName);
if AClass <> nil then
begin
AForm := TComponentClass(AClass).Create(Application) as TCustomForm;
Result := AForm.ShowModal;
end;
end;
·í¨ø¸ü package ®É¡AÃþ§O¥i¥H©ú¥Õ¦a¦b
finalization °Ï¬q¤¤µù¾P¡]Unregister¡^¡A¤]¥i¥HÁô§t¦a¨Ï¥Î
UnRegisterModuleClasses ¨ç¦¡¡C
1. ¸ü¤J¨Ãªì©l¤Æ package¡C
2. ¨Ï¥Î package¡C
3. ¸ê·½¦^¦¬¡]ÄÀ©ñ§A±q package
¤¤«Ø¥ßªºª«¥ó¡^¡C
4. µù¾PÃþ§O¡C
5. ¨ø¸ü package ¡C
ª`·N¨Æ¶µ¤Î«Øij
- ¦UÓ packages
©Ò¥]§tªºµ{¦¡³æ¤¸¦WºÙ¤£¯à¬Û¦P¡A¦Ó¥B¦UÓ
packages §Q¥Î RegisterClass
©Òµù¥UªºÃþ§O¦WºÙ¥²¶·¬°°ß¤@¡C©Ò¥H¦b¬°§Aªº
package ©R¦Wªº®ÉÔ¡Anª`·N¦WºÙ¥i¯à«½Æªº°ÝÃD¡CÁ|¨Ò»¡©ú¡G
¨Ò¤@¡GUnit1.pas
¬O¤@Ó¿W¥ß¥\¯àªºµ{¦¡³æ¤¸¡A¥Ñ©ó¥²¶·¸g±`¨Ï¥Î¨ì¡A¬°¤F¤è«K°_¨£¡A´N§â
Unit1.pas ¥[¤J¨ì PackageA ¤Î PackageB ¤¤¡A³o¨âÓ
package ³£¯à¥¿½T½sĶ³sµ²¡A¦ý¥un¨ä¤¤¤@Ó
package ³Q¸ü¤J¤§«á¡A¥t¤@Ó´NµLªk¸ü¤J¡C
¨Ò¤G¡GPackageA.pkg ¥]§tUnit1.pas¡A¦Ó Unit1
·|µù¥U THelloForm Ãþ§O¡APackageB.pkg ¥]§tUnit2.pas¡A¦Ó
Unit2 ¤]µù¥U THelloForm Ãþ§O¡A³o¨âÓ package
³£¯à¥¿½T½sĶ³sµ²¡A¦ý¥un¨ä¤¤¤@Ó package
³Q¸ü¤J¤§«á¡A¥Ñ©ó THelloForm
¤w¸gµù¥U¹L¡A©Ò¥H¥t¤@Ópackage
¦b¸ü¤J®É´NµLªkµù¥U THelloForm ¦Ó²£¥Í¿ù»~¡C
- ¦P¤@Ó package
¸ü¤J¦h¦¸¨Ã¤£·|µo¥Í¿ù»~¡A¦]¬° RegisterClass
¹ï©ó¦P¤@Ó¤wµù¥U¹LªºÃþ§O¡A¬O¤£°µ¥ô¦ó¨Æ¦Óª½±µªð¦^ªº¡C¦ý¬O¡A¦pªG¤£¦P
package ¤¤¦³¬Û¦PªºÃþ§O¦WºÙ¡A«h¦A¦¸©I¥s
RegisterClass ®É·|¥X²{ EFilerError ªº¿ù»~°T®§¡C
- Package ±M®×¿ï¶µ
- ¨Ï¥Î Runtime package, Explicit rebuild¡C
- Output directory «Øij³]©w¬°¸Ó±M®×¥Ø¿ý¤Uªº
Bin ¥Ø¿ý¡A©ÎªÌ¦b±M®×¥Ø¿ý¤U«Ø¥ß¤@Ó
Packages ¥Ø¿ý¡AµM«á¦b³oÓ Packages
¥Ø¿ý¤U¦s©ñ¦UÓ package ±M®×¡A¦Ó¦UÓ±M®×ªº
Output directory ¥þ³¡³]©w¬° Bin
¥Ø¿ý¡A¨ä¸ô®|Ãþ¦ü³o¼Ë¡GProjects\MyProject\Packages\Bin¡A¦Ó
DCP output directory
«h«ü©w¬°¥Ø«eªº¥Ø¿ý¡A¤]´N¬O "."¡]¤£¥]§t¤Þ¸¹¡^¡AY¤£«ü©wªº¸Ü¡ADelphi5
·|±N²£¥Íªº .DCP Àɮ׿é¥X¦ÜDelphi5\Projects\Bpl\
¥Ø¿ý¤U¡C
Delphi Chat
°Q½×«H¥óºëµØ
°Q½×¥DÃD¡GÀ³¥Îµ{¦¡¼Ò²Õ¤Á³Î°ÝÃD
°Ñ»P¤Hû¡GFang Lin, Hippy, James Fu, MR7, Maxwell Lin,
Michael Tsai, Scott
³o¨Ç°Q½×«H¥ó¬O¨Ì·Ó¤é´Áªº¥ý«á¶¶§Ç±Æ¦C¡A¥Ñ©ó«H¥ó¤¤¤Þ¨¥©Ò¦ûªº¤ñ¨ÒÆZ¤jªº¡A©Ò¥H§Ú°µ¤F¨Ç§R§ï¡A¥Øªº¬O¬°¤F§ó©ö©ó¾\Ū¡AY¦³¤£·í¤§³B©|½Ð¨£½Ì¡C
3-10-2000,
Michael Tsai: Dear all:
§Ú³Ìªñ¹Á¸Õ±N¤@Ó¸ê®Æ®wÀ³¥Îµ{¦¡ªº±M®×¤Á³Î¦¨³\¦h¿W¥ßªº
package ¼Ò²Õ¡A¨Ò¦p¡G«È¤á¼Ò²Õ¡A¼t°Ó¼Ò²Õ¡A¶i³f¼Ò²Õ...µ¥¡C
§Ú¨Ï¥Î¤F°ÊºA¸ü¤J package
ªº¤è¦¡¡A¨Ã¥B¼g¤F´XÓ½m²ß¥Îªº´ú¸Õµ{¦¡¡A¹B§@±oÁÙºâ¦n¡A¥u¬O¦³Ó°ÝÃD¡G¦b¹ê»Úªº±M®×·í¤¤¡A¬°¤F¨D¾Þ§@¤¶±ªº²Î¤@¡A§Ú¤j¶qªº¨Ï¥Î¤Fµøı¤ÆÄ~©Óªº
Form (aka VFI, Visual Form Inheritance)¡A¨C¤@Ó¸ê®ÆºûÅ@§@·~ªºµøµ¡³£Ä~©Ó¦Û¤@Ó°ò¦ªºÃþ§O¡A¨Ò¦p¡GTBaseDataForm¡A¦ý¬O
Delphi package ¤£¤¹³\¨âÓ package
¸Ì±¥]§t¬Û¦Pªº unit¡A³oºØ¨îÅý§ÚµLªk¦b¦UÓ
package ¤¤¨Ï¥Î VFI¡A´¿·Q¹L§ï¥Î DLL¡A¥i¬O DLL
¦b¥þ°ìÅܼƤW¦P¼Ë±oªáµf¥\¤Ò¡A¥B¦U¼Ò²Õ¤§¶¡ªº°Ñ¼Æ¶Ç»¼¤]¨S¦³
package ¨Ó±o¤è«K¡A¤£ª¾¦U¦ì¦³¨S¦³¤°»ò«Øij?
±z«Øij±N¥¦Ì¼¶¼g¦¨ COM ª«¥ó¶Ü?
ÁÂÁÂ!
Michael Tsai
|
3-10-2000,
Fang Lin: Hi:
§Ú¤]¬O±Ä¥Î³oºØ°µªk. ¤]¸I¨ì¬Û¦Pªº¨Æ±¡.
BasePackage ªí¥Ü TBASEDATAFORM©Ò¥]¦¨ªºpackage¦pªGnµøı¤ÆÄ~©ÓForm,
¥²¶·¦bProject Group¤¤±NBasePackage ¥[¤J,§_«h·|¥X²{
TBaseDataForm not foundªº¿ù»~°T®§.
¦b·s«Ø¥ß¤@ÓÄ~©Ó¦ÛTDataBaseFormªºForm®É,
¥²¶·±NActive Project(¥i¯à¬Odpk, or dpr) ³]¦¨
BasePackage, µM«á¦b¿ï¾Ü Main Menu /File/New
¤Á´«¦ÛBasePackage ªº TabSheet, ¦A¿ï¾ÜnÄ~©Óªº
Form§Y¥i, ¥u¬O·s¼WªºForm·|¦Û°Ê¥[¨ìBasePackage¤¤,
ÆZ°Q¹½ªº.
¤£ª¾¹D¦³¨S¦³§ó¦nªº¤èªk?
Fang Lin
|
3-11-2000,
Michael Tsai: Hello, Fang:
§Ú«á¨Ó§â BasePackage ¥Ñ Runtime package §ï¬°
Designtime and runtime package, µM«á install ³oÓ
package, ¤§«á«K¥i¥H¥ô¦ó®ÉÔ¤â°Ê§ó§ï Form
ªº¤÷Ãþ§O¡A°µªk¦p¤U¡G
1. New ¤@ӼзǪº Form¡A°²³]Ãþ§O¦WºÙ¬° TForm1¡C
2. §â TForm1 = class(TForm) §ï¬° TForm1 = class(TMyForm)¡C
3. «ö Alt+F12 (View as text), §â²Ä¤@¦æªº Object
TForm1 ...§ï¦¨ Inherited TForm1 ...¡C¦A«ö¤@¦¸ Alt+F12¡C
ÁöµM¤£§¹¬ü¡A¦ýÁ`ºâ¦³ªk¤l¸Ñ¨M¦b package
¤¤µøı¤ÆÄ~©Ó Form ªº°ÝÃD¤F¡C¦pªGn¦³Ó¤ñ¸û"°®²b"ªº¸Ñ¨M¤è®×¡A©Î³\¼¶¼g¤@ÓForm
Expert ¬O³Ì¦nªº¸Ñ¨M¤è¦¡¡AÃö©ó³o¤è±¡ARay
Lischner ¦³¤@¥»µÛ§@: Hidden Path Of Delphi 3¡A¤¤Ä¶¥»¥Ñ§õºû¥ý¥Í½Ķ¡A¤å»í¥Xª©¡A¸Ì±¦³²{¦¨ªº½d¨Ò»Pµ{¦¡½X¡AÀ³¸Óµy·Lקï´N¯à¨Ï¥Î¡C¤£¹L§ÚÁÙ¬O§Æ±æ¦³¨ä¥L¤ñ¸û²³æ¤Sº}«Gªº¸Ñ¨M¤è®×
...
Michael Tsai
|
3-15-2000,
Maxwell Lin: TO Dear
Michael:
±z³o¼Ëªº°ÝÃD¦³ÂIÃø»¡³á¡C¦]¬°¯à¹³±z³o¼Ë¬[ºcµ{¦¡ªº¤H¤£¦h¡A§óªP½×µûªR³oºØ°µªkªºÀu¦H¡C
§Ú¦b¤½¥q¾D¹Jªº§xÃø¬O¤H¤O¤£¨¬¡A°£¤F¤@¨Ç¦³µ{¦¡ªººûÅ@¤u§@¤§¥~¡F¤j³¡¤À¤u§@³£¸¨¦b¤¶±¤Wªº½Õ¾ã¡C¯u¥¿»P¸ê®Æ¦³ÃöªºBUSINESS
RULE·sµ{¦¡¨ä¹ê¤ñ¸û¤Ö¡C¦]¦¹¤ñ¸û¶É¦V¿W¥ßbusiness
rule¬°¦@¥Î¤¸¥ó¡A¥Ø«e¥¿´ÂµÛCOM+¤è¦V¡C
¦Ü©óµe±³¡¤À¡A´N¨Ì¾Úclient¨Ó¿ï¡C¤ñ¦p¦blan¤W´N¥Îdelphi°µ¡A¦bwww¤W´N¥ÎASP
+ VBScript©ÎASP + JScript¡C
§Ú¸gÅ礤¡Gµe±¦@¥Î©Ê¨ä¹ê«Ü§Cªº¡A¦ý³o¤]¥u¬O§Úªº·Qªk°Õ¡A¤£¤@©w¬O¹ïªº¡C
Maxwell Lin arus@tpts1.seed.net.tw
|
3-15-2000,
Michael Tsai: Hello,
Maxwell:
Ãö©óµe±ªº¦@¥Î©Ê¡A§Úªº·Qªk¬O§â±`¥Îªº¸ê®Æ¾Þ§@¥\¯à¤Îµe±¦w±Æ³]p¦¨°ò¦Ãþ§O¡A³o¼Ë¦h¤H¶}µo®É¡A´N¬Ù±o¼gµe±ªº
spec¡A¥un¨C¦ìµ{¦¡ûÄ~©Ó¦Û°ò¦µøµ¡Ãþ§O´N¦n¤F¡C§Úªº
Form Ãþ§O¤j¬ù¦³¥H¤U´XºØ:
- TBaseDataForm
©Ò¦³ Form ªº¤÷¿Ë, ¦³¤@Ó¥[±j«¬ªº
DBNavigator¡C
- TBrowseEditForm
¦³¤@Ó PageControl¡A¤º¦³¨âÓ TabSheet,
¤À§O´£¨ÑDBGrid ¥i¨ÑÂsÄý¤Î½s¿èÄæ¦ì¸ê®Æ¡C
- TMasterDetailFormA,
TMasterDetailFormB...
¤÷¤lÃöÁpµøµ¡
¦pªGn»¡©ú§Úªº¾ãÓ³]p¡A®£©È±oªá¤W¦n¨Ç½g´T¡A®e§Ú·§z¤@¤G¡G
¦b TBaseDataForm ¤¤©Ò©ñ¸mªº¼W±j«¬ªº DBNavigator,
¼W¥[¤@¨Ç¯S®íªº«ö¶s¡A¦p: ¬d¸ß¡A´M§ä¡A½Æ»s¡A¦C¦L..µ¥¡A§ÚÅý
TBaseDataForm
¤º«Ø¤F¹w³]ªº¸ê®Æ¾Þ§@ªº¥\¯à¡A¨Ã¥B±N³o¨Ç¥\¯à«Å§i¬°µêÀÀ¨ç¦¡¡AÅýÄ~©ÓªÌ¥iµø»Ý¨D§ó§ï즳ªº¥\¯à¡C
¥Ñ©ó§Ú³Ìì©lªº¥Øªº¬O§Æ±æ·í¸ê®Æ®wªºªí®æ¤ÀªR³]p¦n¤§«á¡AÅý
coding ªº³t«×¥[§Ö¡A¦Ó¦b¾ú¸g®É¶¡¦ÒÅç«á¡A¥Ø«eªº³]p¤]ªº½TÅý§Úı±o¬Ù¨Æ«Ü¦h......ª½¨ì§Ú·Qn¼¶¼g¿W¥ßªº¼Ò²Õ¡C
§Ú·Q¡A¦b¼¶¼g¼Ò²Õ®É¡A¨Ï¥Î¼ËªO¡]or
¤¸¥ó¡^n¤ñÄ~©Ó¾A¦X±o¦h¤F¡A¤×¨ä¬O¤@¼h¤S¤@¼hªºÄ~©Ó¤]¬OÆZn©Rªº¡AÁÙ¬O¾¨¶qÁקK±o¦n¡C
Ãö©óµe±¤Î¾Þ§@ªº¤@P©Ê¡A§Ú·Q¥i¯à·|¦]¬°³nÅ骺©Ê½è¤£¦P¦Ó·|¦³¤£¦Pªº¦Ò¶q§a¡A
§Ú²q·Q±zªºµ{¦¡¬Oµ¹¤½¥q¤º³¡¤Hû¨Ï¥Îªº?
Regards,
Michael Tsai
|
3-16-2000,
Hippy: Hello,
´£¨Ñ±z¤@Ó¤p«Øij¡G
¦]¬°¥»¤½¥q¤]¬O¥Îpackage¨Ó°µªº¡C¦Ó¥B°µªº¤@¤Á³£Áٺ⮼¶¶§Q¡]¨ì²{¦b¬°¤î¡^¡C¥u¬O¡A¶}µoªº¶¶§Ç©M§A¦³¤@¨Ç¤£¦P¡I
§ÚÌ¥ý±N¤£¦Pªº¼Ò²Õ¦U¦Û¶}µo¡]EXE§Î¦¡¡^§¹¦¨«á¡A¦A§â¥¦
compile ¦¨ Package¡C¦Ó¥B¡A§Ú̦b¦UӼҲո̡A¤]¬O¦³¦@¥Îªºform¤Î¨Ï¥ÎÄ~©Óªº§Þ¥©¡C
©Ò¥H¡A²³æªº»¡¡A¤]´N¬O¦b¶}µoªº®ÉÔ¡A¥ý
uses ³QÄ~©Óªº form¡AµM«á¡A·sªºform ¦A±q¨ºÃäÄ~©Ó¤U¨Ó¡I³Ì«á¡A¦A±N¦@¥Îªº¯ª¥ý
compile ¦¨ .dcp ¡AµM«á¦A¦U¦Û compile ¨ä¥Lªº¼Ò²Õ¡A³o¼Ë¡AÀ³¸Ó¥i¥H¡C«Øij±z¤£§«¸Õ¸Õ...
Hippy
|
3-21-2000, MR7: > ³o´X¤Ñ½ Delphi
¤â¥U®Éµo²{¤F¤@Ó½sĶ«ü¥Ü¦ü¥G¸òPackage¦³Ãö¡A¦ý¬O§Ú¨S¸Õ¹L
> ¡A¤£ª¾¹D {$WEAKPACKAGEUNIT ON}
¬O¤£¬O§óª½±µªº¤èªk ?
|
3-22-2000,
James Fu: Dear Friend :
>±z³o¼Ëªº°ÝÃD¦³ÂIÃø»¡³á¡C¦]¬°¯à¹³±z³o¼Ë¬[ºcµ{¦¡ªº¤H¤£¦h¡A
>§óªP½×µûªR³oºØ°µªkªºÀu¦H¡C
>§Ú¸gÅ礤¡Gµe±¦@¥Î©Ê¨ä¹ê«Ü§Cªº¡A¦ý³o¤]¥u¬O§Úªº·Qªk°Õ¡A¤£
>¤@©w¬O¹ïªº¡C
´¡Óªá¤@¤U¡A§Ú·Q¤Á³Î¦¨¦n´XÓ¼Ò²Õ³o¼Ëªº¬[ºcÀ³¸Ó¤£¤Ö¡AÓ¤H»{¬°¡A¦³®É¬°¤FºûÅ@¤Wªº¤è«K¡A¤ñ¤è»¡±z¤µ¤Ñ¶}µo¤@ÓÀ³¥Î¨t²Îµ¹±zªº«È¤á¡A¥Î¤F´X¤Ñ¤§«áµoı¦³¤@ÓForm¤W±¥´¤F¤@Ó¿ù¦r©Î¬O¤@Ó³B²z¼g¿ù¤F¡A¤]³\±z¥i¥H§â©Ò¦³ªºµ{¦¡«·sComplier¦¨¤@Ó·sªºexeÀɶǵ¹«È¤á¡A§Y¨Ï±z¨Ï¥Î¤F
D4 or D5 ªº RunTime Package ªº¤è¦¡¡A§Ú·Q¤@Ó¨t²Î¥i¯àÁÙ¬O»Ýn¦n´XMB¡C
¦pªG¦¹®É±z±Ä¥Î¤À³Î¼Ò²Õªº¤è¦¡ªº¸Ü¡A¤]³\±z¥u»Ýn±N¦³°ÝÃDªºµ{¦¡³¡¤À«·s½sĶ¡A¥u»Ýnµ¹¹ï¤è³oקï¹Lªº¡C
·íµM¡AÁÙ¦³³\¦h±¡ªp¥i¥H¨Ï¥Î¨ì¤Á³Î¼Ò²Õªº¦n³B¡A¤×¨ä¬O±z»Ýn¶}µo¨ì°Ó·~®M¸Ë³nÅé®É¡A¨º´N§óÅã±o«n¤F¡C¦Ü©ón§Q¥Î¤°»ò¼Ëªº§Þ³N¨Ó¤Á³Î¡A¦bºô¸ô¤W¦³¤£¤Ö¤¶²Ð§Q¥Î
dll ªº°ÊºA¸ü¤Jªº¤è¦¡¡A¥i¥H°Ñ¦Ò QuickReport
ªººô¦û¦³Ó¤£¿ùªº Sample¡A©Î¬O¼e¹F¥Sªº²`«×¾úÀI¤¤¤]¦³¤£¤Öªº½d¨Ò¡A³o¨Ç©Ò¨Ï¥Îªº¤èªk³£¤j¦P¤p²§¡A±z¥i¥H¿ï¤@Ó¸û¬°¸Ô²Óªº°Ñ¦Ò¬Ý¬Ý¡A³o¥u¬O¤èªk¤§¤@¡C¦Ü©ó¨ä¥Lªº¹³¬OPackage
ªº¤è¦¡¡A©Î¬O¸ü¤J DFM Àɪº¤è¦¡¤]³£¥i¦æ¡C
¦Ü©óµe±¦@¥Î©Ê§ÚÓ¤HˬOı±o¦b¨t²Î¤¤À³¸Ó·|«Ü°ª¡A¤ñ¤è»¡±zªº¨t²Î¤¤¦³
10 °¦¥ª¥kªº¿é¤J¸ê®Æ§@·~¡A±z¤£¤j¥i¯à³o´X¤ä§@·~·s¼W¡B§R°£¡Bק蠟Ãþªº«ö¶s³£³]pªº¤£¦P¤j¤p¡B¦ì¸m§a¡C·íµM°Õ¡A³o¼Ëªº±¡ªp¤U¥i¯à·|Åýµe±¦³¨Ç§bªO¡A¦ý¹ï¨Ï¥ÎªÌ¨Ó»¡©Î³\·|¤ñ¸û®e©ö¤@ÂI¾Ç²ß©O¡H
¤p§Ì¤~²¨¾Ç²L¡A±N¤@¨ÇÓ¤Hªº²L¨£Ä@»P¤j®a¤À¨É¡AÁÙ±æ¤j®a¤£§[«ü±Ð¡C
James Fu
|
3-23-2000,
Michael Tsai: ¸g¹L´X¦¸ªº°Q½×¡A§Ú̪¾¹D¼¶¼g¿W¥ßªº¼Ò²Õªº½T¦³³\¦hÀuÂI¡A¯÷¾ã²z¦p¤U¡G
-
À³¥Îµ{¦¡¥i¥H³Q°ª«×ªº¼Ò²Õ¤Æ¡A¦Ó¥B¥i¥H³vº¥¥æ¥I§¹¦¨ªº¥\¯àµ¹«È¤á¡C
- ºûÅ@¤ñ¸û¤è«K¡C
-
®e©ö¥]¸Ë¦¨¦hºØª©¥»¥H¦]À³¤£¦Pªº¥«³õµ¦²¤¡C
- ¸`¬Ù°O¾ÐÅé¡A¨Ã¥B´£ª@µ{¦¡¸ü¤Jªº³t«×¡C
...¦ü¥G¨S¦³¯ÊÂI:)
¦pªG¥Î Delphi ¤Î BCB
¶}µoªº¸Ü¡AÓ¤Hı±oÁÙ¬O¥Î Package
ªº¤è¦¡¤Á³Î·|¤ñ¸û»´ÃP¡A¥Dn¬O¦]¬°¦b¥Dµ{¦¡»P¦U¼Ò²Õ¤§¶¡«Ü¦³¥i¯à»Ýn¶Ç»¼°Ñ¼Æ¡A¦Ó³o¨Ç°Ñ¼Æ¥i¯à¬O
VCL ª«¥ó¡A¨Ï¥Î DLL ªº¸Ü·|¤ñ¸û³Â·Ð¡C¥t¥~¡ADLL
µLªk¦@¥ÎÅܼơA¦Ó¥²¶·±Ä¥Î¦p memory-mapped
file ©Î¨ä¥L¤è¦¡¨Ó¸Ñ¨M¡A¤]¬On¦Ò¼{ªº¡C
¦Ü©óµe±¦@¥Î¡A§ÚÃÙ¦P±zªº¬Ýªk¡A¨Æ¹ê¤W¡A§Úªºµ{¦¡¤j¶q¨Ï¥Îµøı¤ÆªºFormÄ~©ÓÃö«Y¡A¥H½T«O¾Þ§@¤¶±ªº¤@P©Ê¡C
¶¶«K¤@´£¡AKylix ·|¹ê°µ Linux Shared Object,
¤]´N¬O¹³ DLL ªºªF¦è¡A·Q½Ð±Ð¼ô Linux ªºªB¤Í
.so ¬O§_¥i¥H¹³ package ¤@¼Ë¦@¨É¥þ°ìÅܼÆ?
Regards,
Michael Tsai
|
3-23-2000, James Fu: Dear Friend :
> -
¸`¬Ù°O¾ÐÅé¡A¨Ã¥B´£ª@µ{¦¡¸ü¤Jªº³t«×¡C
¹ï©ó³o¤@ÂIÓ¤H¦³¨Ç¤£¦Pªº¬Ýªk¡A¤ñ¤è»¡¦b¨Ï¥Î¤Á³Îªº¤è¦¡¡A·íµ{¦¡¦b°õ¦æ®É¦pªG¬O±Ä¥Î°ÊºA¸ü¤Jªº¤è¦¡ªº¸Ü¡A¨º³t«×·|¤ñ
Complier ¦b¤@°_ºC¤£¤Ö¡A°O¾ÐÅé¤è±¡AComplier
¦b¤@°_ªº®ÉÔ¤]³\è°õ¦æªº®ÉÔ·|¦ûªº¤ñ¸û¦h¡A¦ý·í±Ä¥Î°ÊºA¸ü¤J®É¦pªG±N©Ò¦³ªº³£¸ü¤J®É¡A¤£¨£±o¦ûªº°O¾ÐÅ餣¨£±o·|¤ñ¸û¤Ö¡C
¦ý¦pªG¾ãÓ¨t²Î¦³¤W¦Ê°¦µ{¦¡¡A¦Ó¨C¦¸°õ¦æ®É¥i¯à¥u·|¥Î¨ì³¡¤Àªºµ{¦¡®É¡A¦b³o¼Ëªº±¡ªp¤U¤]³\·|¤ñ¸û¬Ù°O¾ÐÅé¡C
>...¦ü¥G¨S¦³¯ÊÂI:)
À³¸ÓÁÙ¬O¦³¡A¤ñ¤è»¡¬[ºc´N·|¤ñ¸û½ÆÂø¡A¤½¥ÎÅܼƪº³B²z¡A¤j¶q°Ñ¼Æ¶Ç»¼¡Aª«¥óªº¦@¥Î¡AMDI
¸û¤£®e©ö°µµ¥¡C³o¨ÇÀ³¸Ó¥i¥Hºâ¬O¯ÊÂI§a :
P
>¦pªG¥Î Delphi ¤Î BCB
¶}µoªº¸Ü¡AÓ¤Hı±oÁÙ¬O¥Î Package
>ªº¤è¦¡¤Á³Î·|¤ñ¸û»´ÃP¡A¥Dn¬O¦]¬°¦b¥Dµ{¦¡»P¦U¼Ò²Õ¤§
>¶¡«Ü¦³¥i¯à»Ýn¶Ç»¼°Ñ¼Æ¡A¦Ó³o¨Ç°Ñ¼Æ¥i¯à¬O
VCL ª«¥ó¡A
>¨Ï¥Î DLL ªº¸Ü·|¤ñ¸û³Â·Ð¡C¥t¥~¡ADLL
µLªk¦@¥ÎÅܼơA¦Ó
>¥²¶·±Ä¥Î¦p memory-mapped file
©Î¨ä¥L¤è¦¡¨Ó¸Ñ¨M¡A¤]¬On
>¦Ò¼{ªº¡C
§ÚÓ¤HˬO¤ñ¸û°¾¦V¨Ï¥Î DLL ªº¤è¦¡¡A¨Ï¥Î
Package ªº¸Ü¡A¨º¥u¯à°µ¨ì¤Á³Îµ{¦¡®É©Ò¦³µ{¦¡³£¬O¨Ï¥Î¦P¤@®M¶}µo³nÅé¡A¦ý¨Ï¥Î
DLL ´N¤ñ¸û¨S¦³³o¼Ëªº¨î¡A´N¹³ WinAMP
¥i¥H´£¨Ñ¤@¨Ç¤¶±¥~±¾¨ä¥L¤H©Ò¼gªºªF¦è¤@¼Ë¡C
§Ú¤£¼ô Linux¡A¦ý¦pªGn°µ¨ì³B²z¦@¥ÎÅܼơA¨ä¹ê
DLL ¤£¨£±on¥Î¨ì¹³ memory-mapped file
¨º»ò½ÆÂøªº¤è¦¡¤~¦³¿ìªk°µ¨ì¡A¥i¥H§Q¥Î¹³
RTTI ©Î¬O¤@¨ÇÄ~©Óªº§Þ¥©¡A¤]¬O¥i¥H«Ü®e©öªº°µ¨ìªº¡C
Ó¤H¤@ÂI²L¨£¡AÁÙ±æ¤j®a¦h¦hµ¹¤©«ü±Ð....
James Fu
|
3-25-2000,
Michael Tsai: Hello,
James:
> > -
¸`¬Ù°O¾ÐÅé¡A¨Ã¥B´£ª@µ{¦¡¸ü¤Jªº³t«×¡C
>
¹ï©ó³o¤@ÂIÓ¤H¦³¨Ç¤£¦Pªº¬Ýªk¡A¤ñ¤è»¡¦b¨Ï¥Î¤Á³Îªº¤è¦¡¡A·íµ{¦¡
>
¦b°õ¦æ®É¦pªG¬O±Ä¥Î°ÊºA¸ü¤Jªº¤è¦¡ªº¸Ü¡A¨º³t«×·|¤ñ
Complier ¦b¤@°_ºC¤£¤Ö
> ¡A°O¾ÐÅé¤è±¡AComplier
¦b¤@°_ªº®ÉÔ¤]³\è°õ¦æªº®ÉÔ·|¦ûªº¤ñ¸û¦h¡A¦ý·í
>
±Ä¥Î°ÊºA¸ü¤J®É¦pªG±N©Ò¦³ªº³£¸ü¤J®É¡A¤£¨£±o¦ûªº°O¾ÐÅ餣¨£±o·|¤ñ¸û¤Ö¡C
>
¦ý¦pªG¾ãÓ¨t²Î¦³¤W¦Ê°¦µ{¦¡¡A¦Ó¨C¦¸°õ¦æ®É¥i¯à¥u·|¥Î¨ì³¡¤Àªºµ{¦¡®É¡A¦b³o
> ¼Ëªº±¡ªp¤U¤]³\·|¤ñ¸û¬Ù°O¾ÐÅé¡C
¶â¡Aªº½T¦³³oºØ±¡ªp¡C¤£¹L¡A§ÚÌ¥ý´N°Ê¾÷¨Ó¬Ý¬Ý¡A·í§Ú·Qn±Nµ{¦¡¤Á³Î¦¨¼ÆÓ¿W¥ß¼Ò²Õ®É¡A¥Dnªºì¦]¬O¾ãÓ±M®×¤Ó¹LÃe¤j¤F¡A¦pªG¥þ³¡ªºµ{¦¡½sĶ¦¨¤@¤ä°õ¦æÀÉ¡A¤£¦ý¸ü¤J®É¶¡ªø¡A¦Ó¥BÁÙ¨S¥Î¨ìªº¥\¯à´N¤w¸g¸ü¤J°O¾ÐÅé¸Ì±¡A§Î¦¨®ö¶O¡A¹ï§Ú¨Ó»¡¡A¨Ï¥Î
package ªº°Ê¾÷¤§¤@´N¬On§ïµ½¤Wzªº¯ÊÂI¡A©Ò¥H¤@©w¤£·|¦bµ{¦¡¸ü¤J®É´N§â©Ò¦³¼Ò²Õ³£¸ü¶i¨Ó¡]¤£µM°®¯Ü¥ÎÀRºA³sµ²¦¨¤@¤ä°õ¦æÀÉ¡^¡A§_«h¡A¨S¨É¨ü¨ì°ÊºA¸ü¤J¼Ò²Õªº¦n³B¡A¤Ï¦ÓÁÙ±o³B²z¤@°ï¦@¨ÉÅܼƤΨ禡¶Ç°Ñ¼Æµ¥°ÝÃD¡Aµ¥©ó¦Û¤v§ä³Â·Ð¡C
¦]¦¹¦b³oÓ«e´£¤U¡A±z©Ò´yzªº±¡ªp¤£¨£±o·|µo¥Í¡A¦p¦P¦³¤H°Ý¹L¡A±M®×¦ó®ÉÀ³¸Ó³sµ²
runtime package¡Aµª®×µø±¡ªp¦Ó©w¡A¦pªG§Aªºµøµ¡¨t²Î¤¤¥u¦³¤@¤ä
Delphi 5 ªº°õ¦æÀÉ¡A¨º»ò±z¤]³\·|¥ÎÀRºA³sµ²¡A§_«h§â©Ò¦³¥Î¨ìªº
package ¥[¥[°_¨Ó©Ò¦ûªººÏºÐªÅ¶¡¤@©w¤j©ó¤@¤ä°õ¦æÀɪº
size¡A¦û¥Îªº°O¾ÐÅé¥i¯à¤]¸û¦h¡A¬Û¤Ï¦a¡A·í¨t²Î¤¤¦w¸Ë¦hÓ
Delphi AP
®É¡A°ÊºA³sµ²À³¸Ó·|¬Oµª®×¡C¦Ó¦b§Ú¹ê»Ú¼¶¼gªº±M®×¤¤¡A¤]´X¥G¥þ³¡³£¬O¨Ï¥Î
runtime package¡C
§Ú¬Û«H Package
ªº³]pªº½T¯à°÷Åýµ{¦¡®v¶}µo¥X¸`¬Ù°O¾ÐÅé¡A¨Ã¥B´£ª@¸ü¤J³t«×ªºµ{¦¡¡A¦ý¦nªº¤u¨ã¤£¤@©w¯à³y´N¥X¦nªº²£«~¡A¤u¨ãªº¹B¥Î¬O§_±o©y¡A¦s¥G¤@¤ß¡C
¨º»ò¡A§Ú·QÀ³¸Ó±N¤W±¨º¥y¥[¤W¦ý®Ñ¡A§ï¦¨³o¼Ë¡G
-
¦pªG¹B¥Î±o©y¡A¥i¥H¸`¬Ù°O¾ÐÅé¡A¨Ã¥B´£ª@µ{¦¡¸ü¤Jªº³t«×¡C
> >...¦ü¥G¨S¦³¯ÊÂI:)
>
À³¸ÓÁÙ¬O¦³¡A¤ñ¤è»¡¬[ºc´N·|¤ñ¸û½ÆÂø¡A¤½¥ÎÅܼƪº³B²z¡A¤j¶q°Ñ¼Æ
> ¶Ç»¼¡Aª«¥óªº¦@¥Î¡AMDI
¸û¤£®e©ö°µµ¥¡C³o¨ÇÀ³¸Ó¥i¥Hºâ¬O¯ÊÂI§a :
P
ºâ :)
¯uªº¬O¦³±o¥²¦³¥¢¡C
> §ÚÓ¤HˬO¤ñ¸û°¾¦V¨Ï¥Î DLL
ªº¤è¦¡¡A¨Ï¥Î Package ªº¸Ü¡A¨º
>
¥u¯à°µ¨ì¤Á³Îµ{¦¡®É©Ò¦³µ{¦¡³£¬O¨Ï¥Î¦P¤@®M¶}µo³nÅé¡A¦ý¨Ï¥Î
DLL ´N¤ñ
> ¸û¨S¦³³o¼Ëªº¨î¡A´N¹³ WinAMP
¥i¥H´£¨Ñ¤@¨Ç¤¶±¥~±¾¨ä¥L¤H©Ò¼gªºªF¦è
> ¤@¼Ë¡C
ªº½T¡A¦ý¥Ñ©ó§Ú©Ò¼¶¼gªº¤j³£¬O¸ê®Æ®wÀ³¥Îµ{¦¡¡Aµ{¦¡n¤Á¦¨¼Ò²Õ®É¤´·|¦³¤@©wªº¡]¤ñ¤u¨ã¨ç¦¡®w°ªªº¡^¬Û¨Ì©Ê¡A©Ò¥H¦b¤£©ö¬°¨ä¥Lµ{¦¡»y¨¥¨Ï¥Îªº±¡ªp¤U¡A¶É¦V¨Ï¥Î
package ¦ü¥G¬O¥²µMªºµ²ªG?
> §Ú¤£¼ô Linux¡A¦ý¦pªGn°µ¨ì³B²z¦@¥ÎÅܼơA¨ä¹ê
DLL
> ¤£¨£±on¥Î¨ì¹³ memory-mapped file
¨º»ò½ÆÂøªº¤è¦¡¤~¦³¿ìªk°µ¨ì¡A
> ¥i¥H§Q¥Î¹³ RTTI
©Î¬O¤@¨ÇÄ~©Óªº§Þ¥©¡A¤]¬O¥i¥H«Ü®e©öªº°µ¨ìªº¡C
> Ó¤H¤@ÂI²L¨£¡AÁÙ±æ¤j®a¦h¦hµ¹¤©«ü±Ð....
>
§Ú˧â RTTI µ¹§Ñ¤F¡A«Ý·|¸Õ¸Õ¯à§_¥Î RTTI
¸Ñ¨M±¼¤âÃ䪺¤@¨Ç°ÝÃD :)
Regards,
Michael Tsai
|
3-27-2000,
James Fu: Dear Michael :
> -
¦pªG¹B¥Î±o©y¡A¥i¥H¸`¬Ù°O¾ÐÅé¡A¨Ã¥B´£ª@µ{¦¡¸ü¤Jªº³t«×¡C
¦n¤[¨S¦³¤@«Ê«H¥´¨º»ò¦h¦r¤F¡A¸ò±z°Q½×¯uªº«Ü´r§Ö¡A¤]³\§ÚÌ¥i¥H¦Ò¼{§â§Ú̩ҽͪº³o³¡¤À¦A¥[¤W¤@¨Ç
Sampe Code ©Î¬O Demo
µ{¦¡¤§Ãþªº¡A¤½¶}¦bºô¸ô¤W¡C
>
ªº½T¡A¦ý¥Ñ©ó§Ú©Ò¼¶¼gªº¤j³£¬O¸ê®Æ®wÀ³¥Îµ{¦¡¡Aµ{¦¡n¤Á¦¨¼Ò²Õ®É¤´·|¦³
>
¤@©wªº¡]¤ñ¤u¨ã¨ç¦¡®w°ªªº¡^¬Û¨Ì©Ê¡A©Ò¥H¦b¤£©ö¬°¨ä¥Lµ{¦¡»y¨¥¨Ï¥Îªº±¡
> ªp¤U¡A¶É¦V¨Ï¥Î package
¦ü¥G¬O¥²µMªºµ²ªG?
§ÚÓ¤H¤]´X¥G³£¬O¼g¸ê®Æ®wÀ³¥Îµ{¦¡(¬Ý¨Ó§ÚÌ·d¤£¦n¬O¦P¦æ
: P )¡A
¦]¬°³oÃþªºµ{¦¡¦³®É·|¦]¤£¦Pªº«È¤á¥[´î¤@¨Çµ{¦¡©Î¬O«È¤án¦Û¦æ¼¶¼g¤@¨Ç¯S®íªº¦U®×µ{¦¡¡A¬°¤F©È¦³¨Ç«È¤á¤£·|¥Î
Delphi ¡A©Î¬O¥LÌ·Qn¥Î C++
¤§Ãþªº¡A©Ò¥H·íªì§ÚÓ¤H¦b¨M©w®É¡A´N·|¤ñ¸û°¾¦V
DLL¡C¦ý¬O¼g¤F¤£¤Öµ{¦¡¤U¨Ó¡A¥Ñ©óÓ®×µ{¦¡³q±`©M¨t²Îªº¬Û¨Ì©Ê«Ü°ª(
¤ñ¤è»¡n¦@¥Î Database ªº Session ¤§Ãþªº)¡A©Ò¥H´X¥G³£¬O¨Ï¥Î¦Pª©¥»ªº
Delphi ¨Ó¶}µo¡A¦b³o¼Ëªº±¡ªp¤U¦ü¥G©M¨Ï¥Î
Package ¨S¤°»ò¤j¤£¤F¤F¡A©Ò¥H¥Ø«eÁÙ¬O¨Ï¥Î
DLL ªºì¦]¥u¬O "§Æ±æ"´£¨ÑÅý¨ä¥Lªº
Language ¼gªºµ{¦¡¤@¨Ö¥i¥H±¾¶i¨Ó¡C
James Fu
|
3-27-2000,
Maxwell Lin »P Scott: Maxwell:
¬Q¤Ñ¬Ý¤F¤j®aªº¹ï¸Ü¡A¤~ª¾¹D¦Û¤v¤å¤£¹ïÃD¡C«¢«¢¡A¤H³£¬O·|¦³¥ý¤J¬°¥Dªº·Qªkªº¡C
ÁÙ¬O°µ¤@¨Ç¸É¥R¡GÃö©ó¬Q¤Ñ©Ò´£¨ìªº¨º¨Ç¤èªk»P¹ê§@¡A¨ä¹ê¬OOO
pascalªºª½±µ¹B¥Î¡C
¤ñ¦p»¡
¦bTBaseForm¤¤¡A§ÚÌ©w¸q°ò¥»ªºform¡AµM«áµ¹TBrowserEditForm¡ATMasterDetailFormµ¥¨ÓÄ~©Ó¡A©ó¬O·íTBaseForm¦³©Ò§ó°Ê®É¡ATBrowserEditFormµ{¦¡½X«½sĶ§Y¥i§¹¦¨¬ÛÃöªº×§ï¡C
¤£¹L¡A¼g³o¨Çµ{¦¡½X®É¦³¨Ç¦³½ìªº¤u§@n°µ¡G¥Ñ©óDelphi¦n¹³¨S¦³ª½±µªº¾Þ§@¤¶±Åý±z¿ï¾ÜTBaseForm¡A©Ò¥H»Ýn¤@¨Ç¤â¤ucoding¡C¥H«e§Ú¤]¥Î¦P¼Ëªº¤è¦¡¹B§@¡A¦ý¬O«á¨Óı±o¹ï¤½¥q¨Ã¨S¦³ª½±µ©úÅ㪺À°§U¡A´N¨S¦³°í«ù³oºØ§@ªk¡C(¦ý¹ï©ó¤@¨Ç¤£¥i¨£¤¸¥óªº³]p»P¨Ï¥Î¡A§Ú´N¥ÎÆZ¦hÄ~©Óªº¥\¯à¡C)
Scott:
¨Æ¹ê¤W¡A¥i¨Ï¥ÎRepositoryªº¤è¦¡¡A´N¥i¥H±NTBaseForm¦s¤J¤@¥¹n¨Ï¥Î®É¡Aª½±µ¥ÎFile->New§Y¥iª½±µÄ~©Ó¨ú¥Î¡A°w¹ï³oÓ°ÝÃD¡A¨Æ¹ê¤W¡A§@ÓExpert¥i¯à¬OÓ¤ñ¸û¤è«Kªº°µªk¡C
Maxwell:
¥ÎDLL»PPackage¨ä¹ê¬O¥t¥~¤@Ó«nªºÄ³ÃD¡A°ò¥»¤W¥L²o¯A¨ì§@·~¨t²Î¦p¦óºÞ²zµ{¦¡¡A¦Ó¤£¬O³æ¯Âªºµ{¦¡½X¡C§Úı±o¦pªG³sDLL³£n¦³Ä~©Óªº¥\¯à¡A¥i¯à¬O«Ü¤[¥H«áªº¨Æ¡C§Ú°¾¦Vcom+¤¸¥ó
+ MTSªº¹B§@¼Ò¦¡¡C§Q¥ÎMTSºÞ²zcom+¤¸¥ó¡A¹ï¤½¥q¤é±`ªº¸ê°T¤u§@¤À¤u¦³©úÅ㪺À°§U¡C
Scott:
°w¹ï³oÓ°ÝÃD¨Ó»¡¡A³Ì¥Dnªº°ÝÃD¦b©ó¼Ð·Ç³W®æªº¤£½T©w©Ê¡A
¤§«eCORBA¥sªº¾_¤Ñ»ùÅT¡A «á¨ÓCOM¥X¨Ó¤§«á¡A¥sªº¤H´N¤Ö¤F¡A¦ÓDCOM²{¦b¤S¥sªº³Ì¤jÁn¡A¤@¦¸¤S¤@¦¸ªº³W®æÅܤÆ(©ÎEnhance)¡AÅý°l·s§Þ³NÅܦ¨¬O¥ó·ÀI«Ü¤jªº¨Æ¡C
Maxwell:
¹ï©ó¤½¥q¹B§@¨ä¹ê¬O¦³³o¼Ëªº¬yµ{¡y¤ÀªR->¬[ºc->¹ê§@->ºÞ²z¡z¡A¤ÀªR¤u§@¦p¦óÂà¤Æ¦¨¹ê§@¡H¡I¤å¥ó¦p¦ó¼¶¼g¡H¡Iµ{¦¡½X¤S¦p¦ó§Q¥ÎÄ~©Ó¨ÓºÞ²z¡H³o¨Ç¤u§@³Ì¦n³£¯à°÷¼Ð·Ç¤Æ¡C³o¼Ë¹ï©ó¤é±`¤u§@¤~¯à¥iªø¥i¤[¡C
Scott:
²`¦³¦P·P¡A¦pªG¬O¸ê®Æ®wÀ³¥Îµ{¦¡¡ATableªº³W®æ¡A¬Û¤¬ªº¤Ä½]µ¥µ¥ªºªF¦è¡A¦pDFD¡AData
Dictionary¤§ÃþªºªF¦è¥i¯à¤ñµ{¦¡§ó«n¡C
´N§ÚÓ¤Hªº·Qªk¨Ó»¡¬O¤ñ¸û°¾¦V¨Ï¥ÎDLL¥H¤Îµ{¦¡¤¤ªºÄ~©Ó¨Ó°t¦X¡Aì¦]¦b©óPackage¥i¯à¦]Delphiªº§ïª©¦ÓÅÜ°Ê(Delphi3¬O*.dpl¡A4,5¬O*.bpl)¦]¦Ó»Ýn«Build¡A·ÀI©Ê¤Ó¤j¡A¤×¨ä¬O¦b¸ê°T¤Hû¬y°Ê©Ê¦p¦¹°ªªº²{¹êª¬ªp¤U¡A§ïª©´X¥Gµ¥©ó«¼g¡A¦ÓDLLÁöµM¼g§@¤W¤ñ¸û³Â·Ð¡A¦ý¥H«áºûÅ@¤Wµ´¹ï¬O¤ñ¸û¤è«K¡A¥Ñ©óDLL´X¥G¬OӼзǡA¥un¿í¦u¤@©wªº·Ç«h¡A¨Ã¤£·|¦]¬°Delphi§ïª©´N¤£¯à¥Î¦Ón«·sBuild¡C
°t¦XDLLªº¨Ï¥Î¡ARTTI¦ü¥G¤]¬OӸѨM¤è¦¡¡A¦ý¦b¨C¥»°÷¥÷¶qªºDelphi®Ñ¤¤³£¦A¤T´£¿ôRTTIÅܰʪº¥i¯à©Ê¡A¤£¹L¡A¥]¶iDLLÀ³¸Ó¨S¦³³oÓ°ÝÃD¡C
¦Ü©ó¦@¥ÎDLLªº°ÝÃD¡A¨Æ¹ê¤W¡A®Ú¾Ú¤j¦h¼Æ¤Hªº¸gÅç¬O¤£¤Ó¥i¯àªº¡Cì¦]¬O¦Û¤v¨S¿ìªk±±¨î¡Aì¦]¦b©óDLL¤º³¡¨ç¦¡³B²zªº°Ê§@¨ÃµLªk³z©ú¤Æ¡AÁöµM¦bOO
±j½Õ«Ê¸Ë¡A¦ý¤@¥¹§@¨ì¤ñ¸û²Ó¶µªº±±¨î®É¡Aµ{¦¡ªº¥i±±¨î©Ê¬O¤Q¤À«nªº¡C
Ó¤Hªº¸gÅç¬O¦b¦Û¤vDebug¥b¤Ñ¤§«áµo²{¦Û¤vªºµ{¦¡¨S¦³°ÝÃD¡A¦Óµo²{°ÝÃD¥i¯à¥X¦b¨ä¥Lªº°ÝÃD(¦pAPI¡AProgram¡ADriver......)
µ¥µ¥¡A¬°¤Féw©Ê¡A¦ü¥G°£¤F¦Û¤v«¼g¨Ó±±¨î¸ê®Æ¥H¥~¡A¤]¨S¦³¥t¥~ªº¸Ñ¡C
¼gµ{¦¡¼g¨ì«á¨Ó¡A§Ú´X¥G¤£¤Ó´±¨Ï¥Î§O¤H¼gªº¤¸¥ó©Î¬O«D¼Ð·Ç¤¸¥ó¡A·íµM³o¤w¸g¬OÃD¥~¸Ü¤F......¡C
|
http://geocities.datacellar.net/huanlin_tsai/