ÔÚÆÁÄ»ÉϻͼµÄC££ÊµÏÖ´úÂë
DllImportËùÔÚµÄÃû×Ö¿Õ¼ä using System.Runtime.InteropServices;
[DllImport("User32.dll")]
public extern static System.IntPtr GetDC(System.IntPtr hWnd);
private void button19_Click(object sender, EventArgs e)
{
System.IntPtr DesktopHandle = GetDC(System.IntPtr.Zero);
Graphics g = Graphics.fromHdc(DesktopHandle);
g.DrawRectangle(new Pen(Color.Red),new Rectangle(10,10,100,100));
}
Ïà¹ØÎĵµ£º
Ç°¼¸ÌìдÁ˹ØÓÚKeilÓëC/C++»ìºÏ±à³ÌµÄÈô¸ÉÎÊÌ⣬½ñÌìдµÄÊǼÌÐøÇ°ÃæµÄ¡£
ÔÚʹÓÃC/C++»ìºÏ±à³ÌµÄʱºò£¬³ÌÐòÔËÐе½ÀàÀïÃæµÄÐéÄ⺯ÊýʱËÀµô£¬²é¿´ÆävptrֵΪ0x00000000£¬Õâʱºò²»ÖªµÀÔõô½â¾ö£¬ºóÀ´×Ô¼º±àÁËÒ»¸öʵÀý³ÌÐò¿ÉÒÔͨ¹ý£¬·¢ÏÖvptrµÄÖµÊÇÔÚ__mainÀïÃæµÄ& ......
ijЩÇé¿öÏÂÏ£Íûº¯ÊýµÄ²ÎÊý¸öÊý¿ÉÒÔ¸ù¾ÝÐèҪȷ¶¨¡£µäÐ͵ÄÀý×ÓÓдó¼ÒÊìϤµÄº¯Êýprintf()¡¢scanf()ºÍϵͳµ÷ÓÃexecl()µÈ¡£ÄÇôËüÃÇÊÇÔõÑùʵÏÖµÄÄØ£¿C±àÒëÆ÷ͨ³£ÌṩÁËһϵÁд¦ÀíÕâÖÖÇé¿öµÄºê£¬ÒÔÆÁ±Î²»Í¬µÄÓ²¼þƽ̨Ôì³ÉµÄ²îÒ죬Ôö¼Ó³ÌÐòµÄ¿ÉÒÆÖ²ÐÔ¡£ÕâЩºê°üÀ¨va_start¡¢ va_argºÍva_endµÈ¡£
²ÉÓÃANSI±ê×¼ÐÎʽʱ£¬²ÎÊý¸öÊý¿É± ......
public¿ÉÒÔ±»ÈÎÒâ´æÈ¡£»
protectedÖ»¿ÉÒÔ±»±¾ÀàºÍÆä¼Ì³Ð×ÓÀà´æÈ¡£»
internalÖ»¿ÉÒÔ±»±¾×éºÏÌ壨Assembly£©ÄÚËùÓеÄÀà´æÈ¡£¬×éºÏÌåÊÇC#ÓïÑÔÖÐÀà±»×éºÏºóµÄÂß¼µ¥Î»ºÍÎïÀíµ¥Î»£¬Æä±àÒëºóµÄÎļþÀ©Õ¹ÃûÍùÍùÊÇ“.DLL”»ò“.EXE”¡£
protected internalΨһµÄÒ»ÖÖ×éºÏÏÞÖÆÐÞÊηû£¬ËüÖ»¿ÉÒÔ±»±¾×éºÏÌåÄÚ ......
µÚÒ»²¿·ÖÈí¼þ±à³ÌµÄʱ¼ä·ÖÅä¸Å¿ö
¸ßЧÂʵijÌÐòÔ±²¢²»ÊÇÇüüÅ̵ÄËٶȱȱðÈ˿죬¶øÊÇËûÓÐ×ÅÁ¼ºÃµÄ±à³ÌÏ°¹ß£¬½ÚÊ¡Á˱ðÈËÀ˷ѵÄʱ¼ä¡£Òò´Ë£¬ÒªÏëÌá¸ß×Ô¼ºµÄ±à³ÌЧÂÊ£¬¸ù±¾ÔÚÓÚÔõôÉÙÀË·Ñʱ¼ä¡£Ö»ÒªÄܰѱðÈËÀ˷ѵÄʱ¼ä½ÚÊ¡ÏÂÀ´£¬ÄãµÄЧÂʾͿÉÒÔ¿ì¹ý±ðÈË£¬ÉõÖÁÊý±¶ÓÚ±ðÈË¡£ÒªÏë½Úʡʱ¼ä£¬µ±È»Ê×ÏÈÐèÒªÃ÷°×±à³ÌÖкķ ......
1.c++µÄµ½´¦º¯ÊýÖ»ÒªÔÚº¯ÊýÉêÃ÷µÄʱºò¼Ó¸öµ¼³ö¹Ø¼ü×־ͿÉÒÔÁË
2.²ÎÊýÀàÐÍÎÊÌâ,
Ò»°ãµÄc++ÖÐchar * ¶ÔÓ¦ c#ÖеÄstring
¶øc++ÖÐ char **ÀàÐ͵IJÎÊý¶ÔÓ¦c#ÖÐ ref string ÕâÖÖÒ»°ã¶¼ÊÇÓÃÀ´·µ»Ø×Ö·û´®µÄ!
3.º¯ÊýÈë¿ÚÎÊÌâ,Ò»°ã»á³öÏÖ "ÕÒ²»µ½Èë¿Úµã" Õâ¸öÎÊÌâ²»ÊÇÓÉÄãÒýÆðµÄ,¶øÊÇϵͳ×Ô¼º°ÑÃû×Ö¸ÄÁË,¸Ä³ÉʲôÑùµÄÃû×Ö½¨ÒéÄãÓà ......