±¾ÎÄʹÓÃÒ»¸ö¼òµ¥ÊµÀý½²ÊöÈçºÎʹÓöà̬ÔÚDelphiÖÐʵÏÖ¶¯Ì¬±à³Ì¡£
¶à̬£¨Polymorphism£©°´×ÖÃæµÄÒâ˼¾ÍÊÇ“¶àÖÖÐÎ×´”¡£ÒýÓÃCharlie Calverts¶Ô¶à̬µÄÃèÊö——¶à̬ÐÔÊÇÔÊÐíÄ㽫¸¸¶ÔÏóÉèÖóÉΪºÍÒ»¸ö»ò¸ü¶àµÄËûµÄ×Ó¶ÔÏóÏàµÈµÄ¼¼Êõ£¬¸³ÖµÖ®ºó£¬¸¸¶ÔÏó¾Í¿ÉÒÔ¸ù¾Ýµ±Ç°¸³Öµ¸øËüµÄ×Ó¶ÔÏóµÄÌØÐÔÒÔ²»Í¬µÄ·½Ê½ÔË×÷¡£¸ü¶àÓйضà̬µÄ½²Êö£¬Çë²Î¿¼ÍøÂç×ÊÁÏ¡£
“¶¯Ì¬ÓïÑÔ“ÊÇÒ»ÖÖÔÚÖ´ÐÐÆÚ¼ä²ÅÈ¥·¢ÏÖÊý¾ÝÀàÐ͵ijÌÐòÉè¼ÆÓïÑÔ£¬ÆäÓеãÔÚÓÚÆäÓÅÁ¼µÄÀ©Õ¹ÐÔ£¬Ö÷ÒªÓÃÓÚ´´½¨Ò»Ð©ÐèÒª¾³£¸üÐµĶ¯Ì¬ÏµÍ³¡£±¾ÎÄÃèÊöµÄ¶¯Ì¬±à³Ì£¬Ã»Óж¯Ì¬ÓïÑÔµÄÒâ˼£¬µ«ÊÇÄÜÈÃDelphi³ÌÐòͬÑù¾ßÓж¯Ì¬À©Õ¹µÄÄÜÁ¦¡£
ÒÔPolymorphismµÄ×ÖÃæÒâ˼À´¾ÙÀý£¬ÒªÊµÏÖÒ»¸ö»³ö¸÷ÖÖÐÎ×´µÄ³ÌÐò¡£¸Õ¿ªÊ¼£¬¿ÉÄÜÖ»ÐèҪʵÏÖ»¾ØÐΡ¢Õý·½ÐεŦÄÜ£¬µ«ÊÇ¿ÉÔ¤ÖªÒÔºóÐèÒª»ÆäËüͼÐΡ£ÕâºÜ×ÔÈ»Ï뵽ʹÓöà̬À´ÊµÏÖ£¬¿ÉÊÇÈçºÎʵÏÖÔÚÔö¼ÓÆäËüÐÎ״ʱÖ÷³ÌÐòÍêÈ«²»ÓÃÐÞ¸ÄÄØ£¿
Ò»¡¢ÊµÀýÃèÊö£º
1. ³éÏóÀàTGeometry£¨¼¸ºÎͼÐΣ©£¬ËüÓÐÒ»¸ö»Í¼ÐεijéÏó·½·¨Draw()
2. ¼Ì³Ð³éÏóÀàµÄ×ÓÀࣺTRectangle£¨¾ØÐΣ©¡¢TSquare£¨Õý·½ÐΣ©µÈµÈ¡£ËùÓÐÀàÈçÏÂͼ
3. Main³ÌÐòÎÞÐëÖªµÀ×ÓÀֻ࣬ͨ¹ýTGeometry»³ö¸÷ÖÖͼÐΣ¬Ò²ÎÞÐë¹ØÐÄ ......
http://social.msdn.microsoft.com/Forums/en-US/windowspro-audiodevelopment/thread/5ce74d5d-2b1e-4ca9-a8c9-2e27eb9ec058
it's work in Delphi 7
//////////////////////////
unit MMDevApi;
interface
uses
Windows, ActiveX, ComObj;
const
CLASS_IMMDeviceEnumerator : TGUID = '{BCDE0395-E52F-467C-8E3D-C4579291692E}';
IID_IMMDeviceEnumerator : TGUID = '{A95664D2-9614-4F35-A746-DE8DB63617E6}';
IID_IMMDevice : TGUID = '{D666063F-1587-4E43-81F1-B948E807363F}';
IID_IMMDeviceCollection : TGUID = '{0BD7A1BE-7A1A-44DB-8397-CC5392387B5E}';
IID_IAudioEndpointVolume & ......
ΪºÎÓÐÈËÏÓÆúdelphi?
¸öÈË×î½üѧϰÓÞ¼û
2009Äê9ÔÂ23ÈÕ9:26:08£¨½ñÌìÇï·Ö£¬Ì«Ñô»áÖð½¥À뿪³àµÀÏòÄϻعéÏßÒÆ¶¯£¬Ì«Ñô»áÒ»ÌìÌìµÄÔ¶ÀëÎÒÃDZ±°ëÇò£¬×¢ÒⱣů¡££©
±¾ÈË×î½ü±»ÐµÄÊÂÎï³å»èÁËÍ·¡£Windows7¡¢Delphi2010¡¢VS2008+SP1¡¢VS2010¡¢Office2010µÈµÈһЩÈí¼þµÄ³öÏÖ£»3GÀ´ÁË£¨Ã»ÓÐǮûÓÐÌå»á£©£»Iphone£¨MAC£©£¬Android£¨GoogleµÄ£©£¬Linux£¨Ç¶Èëʽ·½ÏòµÄ¡£Android´ÓËüÅÉÉúµÄ°É£©£¬Èû°à£¨Åµ»ùÑÇ£¬²»¹ýÌý˵ËûÃÇÓÐÓÃеIJÙ×÷ϵͳÁË£©µÈµÈ¼¸¸ö¾ÞÍ·ÔڹϷÖ×ÅÒÆ¶¯É豸Ҳ¾ÍÊÇδÀ´µÄ¸öÈ˵çÄԵIJÙ×÷ϵͳÁìÓò¡£Google°Ù¶È¶¼Ðû²¼ÒªÑз¢²Ù×÷ϵͳÁË£»»¹ÓÐÊ²Ã´ÔÆÁË£¬¿òÁ˵ȵȾÍÒ»¸ö¸Ð¾õÔΣ¬ÊÀ½ç·¢Õ¹Ì«TMDµÄ¿ìÁË£¬¸Ð¾õ×Ô¼º¸ü¼ÓÃìСÁË¡£
ÎҵĵÚÒ»¸ö±à³ÌÓïÑÔDelphi£¬Ëµµ½ËýÓÐÖÖĪÃûµÄÉ˸С£Ãû×ֺܺÃÌýµÄ£¬ÊÇÏ£À°Éñ»°ÖÐÒ»¸öÅ®ÉñµÄÃû×Ö¡£´ÓCSDNÉÏÃæ¿´µ½09Äê8Ô·ݱà³ÌÓïÑÔÅÅÐаñÉÏÃæDelphiµÄÅÅÃûΪµÚ11Ãû£¬Õâ¸ö±»anders´´Ô죬ÔÚBorland»Ô»Í£¬¶ø±»BorlandתÊÖ¸øÒײ©ÁúµÄÉñ»°ÄѵÀ¾Í´ËûÂäÁËÂð£¿Õâ¸ö¿ÉÊÇÎÒ²»Ïë¿´µ½µÄ¡£ËýÊÇÎÒµÄÐÅÑö£¬ÎÒµÄĸÓËýÈÃÎÒµÚÒ»´ÎÌå»áµ½±ä³ÉµÄ¿ìÀÖ£¬ÎÒ²»ÄÜ˵ËýûÓÐȱµã£¬µ«ÊÇÎÒ²»ÄÜ˵Ëý»µ£¬²»ÄÜ˵Ëý²»ºÃ¡£
ºÜ¶àÈË˵Ëý²»ºÃ£ºÓÐЩÊÇDelphi°ÑËû´øÈë±à³ÌÊÀ½çµÄ£¬“Ëü ......
ÖÚËùÖÜÖª£¬ÏµÍ³ÐèÒª½øÐжàÈ˲¢Ðпª·¢Ê±£¬Ó¦¸Ã°Ñϵͳ·Ö²ð³É¶ÀÁ¢µÄÄ£¿é£¬ÕâÑù²ÅÄܱÜÃ⿪·¢³åÍ»¡£µ«ÈçºÎ½øÐзֲðÄØ£¿ÔÚDelphiϵͳÖУ¬ÓкܶàÖÖ·½·¨£¬ÏÂÃæÀ´½øÐÐÒ»Ò»½éÉÜÓë·ÖÏí¡£
1.°ÑÄ£¿é²ð·Ö³É°ü(dpk)£¬Ö±½ÓÔÚÖ÷³ÌÐòÖÐͨ¹ýLoadPackageº¯Êý°Ñ°ü×°ÔØ½øÀ´¼´¿É¡£²»¹ýÕâÖÖ·½·¨Ò²ÓÐЩ²»±ã£¬ËùÓеÄÀà±ØÐë¼Ì³Ð×ÔTPersistentClass£¬²¢ÇÒRegisterClassÖ®ºó²ÅÄܱ»GetClass´ÓÖ÷³ÌÐò»ñÈ¡£¬ÕâÑù²Ù×÷Ò²ÊDZȽÏÂé·³µÄ¡££¨²»ÍƼöʹÓã©
2.°ÑÄ£¿é²ð·Ö³ÉDLL£¬±àÒëʱ²»´ø°ü±àÒ루ÎÊÌ⣺ÓÉÓÚÀàÔÚ¶ÀÁ¢µÄ¿Õ¼ä£¬Ê¹ÓÃÍⲿ°üʱ£¬ÈÝÒײúÉúÀ಻¼æÈݵÄÎÊÌ⣬ÔÚDLLÖÐÅжÏÀàÊÇ·ñ¼Ì³Ð×ÔÖ÷exeÖеĶÔÏóÊDz»Ðе쬶øÕâÖÖÐèÇóÓÖ¾³£³öÏÖ£¬Òò´Ë²»ÍƼöʹÓÃÕâÖÖ·½Ê½¡££©
3.°ÑÄ£¿é²ð·Ö³ÉDLL£¬±àÒëʱ´ø°ü±àÒ루ÔÚproject->Options->PackagesÖаÑBuild with runtime packagesÑ¡ÉÏ£©£¬È»ºó°ÑÐèÒªµÄ°ü´ø½øÈ¥¼´¿É£¬Ö÷³ÌÐòÒ²ÊÇ´ø°ü±àÒ룬ÕâÑùÖ÷³ÌÐòÓëDLL¾Í»áʹÓù²Í¬µÄÀà·ÖÅä±í¿Õ¼ä£¬¶ÔÏàͬµÄÀà¾Í¿ÉÒÔ½øÐмæÈÝÅжÏÁË£¬ÕâÑù¾Í¿ÉÒÔʹÓÃDLLÖм̳Ð×Ô¹«¹²°üÖеĻùÀàÀ´ÊµÏÖ¹¦ÄÜÁË£¬ÁíÍâÕâÑù»¹¿ÉÒÔ±ÜÃâºÜ¶àÎÊÌ⣬ÈçʹÓõÚÈý·½¿Ø¼þ²úÉúµÄÆæ¹ÖÎÊÌ⣬DLL½¨Á¢µÄ×Ó´°¿ÚÎÞ·¨ÔÚÖ÷´°¿ÚÖГ´æ»î”µÄÎÊÌ⣬µÈµÈ¡£
4.°ÑÄ£¿é²ð· ......
dpr Ϊ¹¤³ÌÎļþ
dfm Ϊ´°ÌåÎļþ
pas Ϊµ¥ÔªÎļþ
cfg ÅäÖÃÎļþ
dof ΪÏîĿѡÏîÎļþ(Ò»°ãûÓÃ)
dcu compiled unitsÎļþ ,±àÒëºóµÄµ¥ÔªÎļþ
res ×ÊÔ´Îļþ
ddp Îļþ¾ÍÊÇDelphi Diagram Portfolio¼òд,ÊÇÓÃÀ´±£´æCode EditorÖеÄDiagramÐÅÏ¢µÄ.
Ò»°ãÒ»¸öÏîĿҪ¿¼¸ö±ðÈË,Ö»ÐèÒª dpr,dfm,pasÎļþ¼´¿É,Èç¹ûÓÐcfg,resÒ²Ò»¿é¿¼(ºóÁ½¸öÎļþºÜÉÙÓõ½) ......
Ï£Íû´ó¼ÒÔÚתÌùµÄʱºò×¢Ã÷³ö´¦£¬Ð»Ð»)
ÓÃDELPHI¿ª·¢ÍøÂç´úÂëÒѾÓÐÒ»¶Îʱ¼äÁË£¡
ÎÒ·¢ÏÖÔÚÍøÉÏÓÃVCÀ´ÊµÏÖÍê³É¶Ë¿Ú£¨IOCP£©µÄ´úÂëºÜ¶à£¬µ«ÊÇʹÓÃDELPHIÀ´ÊµÏֵľͱȽÏÉÙÁË¡£¶ÔIOCP½²µÄÇå³þµÄ¾Í¸üÉÙÁË¡£ÔÚÕâÀïÎÒ°Ñ×Ô¼º±àдDELPHIϵÄIOCPд³öÀ´£¬Ï£Íû¶Ô¸ÕѧÍê³É¶Ë¿ÚµÄÅóÓÑÓиö°ïÖú¡£
Ê×ÏÈÎÒÃÇÀ´Á˽âһЩÔÚʹÓÃIOCPµÄʱºòÐèҪʹÓõÄһЩ½á¹¹£¡
£¨1£©£ºµ¥IOÊý¾Ý½á¹¹
LPVOID = Pointer;
LPPER_IO_OPERATION_DATA = ^ PER_IO_OPERATION_DATA ;
PER_IO_OPERATION_DATA = packed record
Overlapped: OVERLAPPED;
DataBuf: TWSABUF;
Buffer: array [0..1024] of CHAR;
BytesSEND: DWORD;
BytesRECV: DWORD;
end;
ÉÏÃæµÄ½á¹¹ÖÐOverlapped: OVERLAPPED;ºÍDataBuf: TWSABUF;Êǹ̶¨µÄ½á¹¹ÀàÐÍ¡£Buffer: array [0..1024] of CHAR;ÊÇÓÃÀ´±£´æ½ÓÊÜÊý¾ÝµÄ»º´æ¡£BytesSEND: DWORD;ÓÃÀ´±êÖ¾·¢ËÍÊý¾ÝµÄ³¤¶È¡£BytesRECV: DWORD;ÓÃÀ´±êÖ¾½ÓÊÜÊý¾ÝµÄ³¤¶È¡£ÒòΪÍê³É¶Ë¿ÚµÄ¹¤×÷ÕßÏ߳̿ÉÒÔ½ÓÊܵ½À´×Ô¿Í»§¶ËµÄÊý¾Ý£¬Í¬Ê±»¹¿ÉÒÔ½ÓÊܵ½×Ô¼º·¢Ë͸ø¿Í»§¶ËµÄÊý¾Ý£¬ ......