±àÒë³öÀ´µÄc/c++³ÌʽµÄ²ÎÊýѹջ˳ÐòÖ»ºÍ±àÒëÆ÷Ïà¹Ø!
ÏÂÃæÁоÙÁËһЩ³£¼ûµÄ±àÒëÆ÷µÄµ÷ÓÃÔ¼¶¨
VC6:
µ÷ÓÃÔ¼¶¨ ¶ÑÕ»Çå³ý ²ÎÊý´«µÝ
__cdecl µ÷ÓÃÕß ´ÓÓÒµ½×ó,ͨ¹ý¶ÑÕ»´«µÝ
__stdcall º¯ÊýÌå ´ÓÓÒµ½×ó,ͨ¹ý¶ÑÕ»´«µÝ
__fastcall º¯ÊýÌå ´ÓÓÒµ½×ó,ÓÅÏÈʹÓüĴæÆ÷(ECX,EDX),È»ºóʹÓöÑÕ»
thiscall º¯ÊýÌå thisÖ¸ÕëĬÈÏͨ¹ýECX´«µÝ,ÆäËû²ÎÊý´ÓÓÒµ½×óÈëÕ»
__cdeclÊÇC£ÜC++µÄĬÈϵ÷ÓÃÔ¼¶¨; VCµÄµ÷ÓÃÔ¼¶¨Öв¢Ã»ÓÐthiscallÕâ¸ö¹Ø¼ü×Ö,ËûÊÇÀà³ÉÔ±º¯ÊýĬÈϵ÷ÓÃÔ¼¶¨;
C£ÜC++ÖеÄmain(»òwmain)º¯ÊýµÄµ÷ÓÃÔ¼¶¨±ØÐëÊÇ__cdecl,²»ÔÊÐí¸ü¸Ä;
ĬÈϵ÷ÓÃÔ¼¶¨Ò»°ãÄܹ»Í¨¹ý±àÒëÆ÷ÅäÖýøÐиü¸Ä,¼ÙÈçÄúµÄ´úÂëÒÀÀµÓÚµ÷ÓÃÔ¼¶¨,ÇëÃ÷È·Ö¸³öÐèҪʹÓõĵ÷ÓÃÔ¼¶¨;
C++Builder6:
µ÷ÓÃÔ¼¶¨ ¶ÑÕ»Çå³ý ²ÎÊý´«µÝ
__fastcall º¯ÊýÌå ´Ó×óµ½ÓÒ,ÓÅÏÈʹÓüĴæÆ÷(EAX,EDX,ECX),È»ºóʹÓöÑÕ» (¼æÈÝDelphiµÄregister)
(registerºÍ__fastcallµÈͬ)
__pascal º¯ÊýÌå ´Ó×óµ½ÓÒ,ͨ¹ý¶ÑÕ»´«µÝ
__cdecl µ÷ÓÃÕß ´ÓÓÒµ½×ó,ͨ¹ý¶ÑÕ»´«µÝ(ºÍC£ÜC++ĬÈϵ÷ÓÃÔ¼¶¨¼æÈÝ)
__stdcall º¯ÊýÌå ´ÓÓÒµ½×ó,ͨ¹ý¶ÑÕ»´«µÝ(ºÍVCÖеÄ__stdcall¼æÈÝ)
__msfastcall º¯ÊýÌå ´ÓÓÒµ½×ó,ÓÅÏÈʹÓüĴæÆ÷(ECX,EDX
Ïà¹ØÎĵµ£º
VB
If MSComm1.PortOpen = True Then MSComm1.PortOpen = False
MSComm1.CommPort = i1
MSComm1.PortOpen = True
MSComm1.InputMode = comInputModeBinary
MSComm1.InBufferCount = 0
& ......
ÕâƪÎÄÕÂÊÇʹÓÃSQLite C/C++½Ó¿ÚµÄÒ»¸ö¸ÅÒª½éÉܺÍÈëÃÅÖ¸ÄÏ¡£
ÓÉÓÚÔçÆÚµÄSQLiteÖ»Ö§³Ö5¸öC/C++½Ó¿Ú£¬Òò¶ø·Ç³£ÈÝÒ×ѧϰºÍʹÓ㬵«ÊÇËæ×ÅSQLite¹¦ÄܵÄÔöÇ¿£¬ÐµÄC/C++½Ó¿Ú²»¶ÏµÄÔö¼Ó½øÀ´£¬µ½ÏÖÔÚÓг¬¹ý150¸ö²»Í¬µÄAPI½Ó¿Ú¡£ÕâÍùÍùʹ³õѧÕßÍû¶øÈ´²½¡£ÐÒÔ˵ÄÊÇ£¬´ó¶àÊýSQLiteÖеÄC/C++½Ó¿ÚÊÇרÓõģ¬Òò¶øºÜÉÙ±»Ê¹Óõ½¡£¾¡¹ÜÓÐÕâ ......
Delphi Óë C/C++ Êý¾ÝÀàÐͶÔÕÕ±í
DelphiÊý¾ÝÀàÐÍC/C++
ShorInt
8λÓзûºÅÕûÊý
char
Byte
8λÎÞ·ûºÅÕûÊý
BYTE,unsigned short
SmallInt
16λÓзûºÅÕûÊý
short
Word
16λÎÞ·ûºÅÕûÊý
unsigned short
Integer,LongInt
32λÓзûºÅÕûÊý
int,long
Cardinal,LongWord/DWORD
32λÎÞ·ûºÅÕûÊý
unsigned long
Int6 ......
ÀîÈôÀÏʦÔø¾Ëµ£ºÊÀ½çÉϵijÌÐòÔ±·ÖÈýÖÖ£¬Ò»ÖÖÊÇÓÃEmacs£¬Ò»ÖÖÊÇÓÃVimµÄ£¬ÆäËüµÄ¹éΪµÚÈýÖÖ¡£ÆäÒâÊÇ˵Èç¹ûÒ»¸ö³ÌÐòÔ±Á½Õ߶¼²»ÓõĻ°£¬ÄÇ´óµÖÊDz»ÄÜ
¹éΪÈëÁ÷ÕßÐÐÁеġ£¶ÔʹÓÃC/C++µÄÈËÀ´Ëµ£¬ºÜ¶àÈËϲ»¶Emacs£¬¾Ý˵Óë¶ÔStallmanµÄ³ç°ÝÓë°®Îݼ°ÎÚÓйØ;-)¡¡µ±È»£¬EmacsÓëVimËä
È»ÔÚÎı¾±à¼·½ÃæµÄÐÔÄÜÊǵȼ۵ģ¬µ«Ê¹ÓÃÆðÀ´Á½Õ ......