C# ¿É·ñ¾²Ì¬Á´½ÓC ÓïÑÔÉú³ÉµÄLib ¿â£¿
RT¡£C++/CLI Ëƺõ¿ÉÒÔ
²»ÖªµÀ£¬Â·¹ý°ï¶¥
¿ÉÒÔ°É£¬
Private Declare Function QueryPerformanceCounter Lib "kernel32" (ByVal lpPerformanceCount As Long) As Boolean
Private Declare Function QueryPerformanceFrequency Lib "kernel32" (ByVal lpFrequency As Long) As Boolean
×ö¾«È·¼ÆʱʱµÄµ÷Óá£
LS£¬ÄãÄǸöÊÇVB ´úÂë°É¡£¡£¡£
ÏÖÔÚÎÒÏëÖªµÀ C# ºÍ C++/CLI »ìºÏ±à³ÌÊÇ·ñ¿ÉÐУ¿
´¿´â¸öÈ˹۵㣺²»ÐС£
C# µ÷ÓÃC++/CLI Éú³ÉµÄLIB Ò²²»¿ÉÒÔÂð£¿ÒòΪ°²È«·½ÃæµÄÔÒòÖ»ÄÜÓÃLIB ²»ÄÜÓÃDLL£¬£¬Ôõô°ì°¡£¡£¡£¡
²»ÖªµÀ,òËÆÒÔÇ°ÓÐÈË˵¹ýÕâ¸öÎÊÌâ,ÍüÁ˽á¹ûÁË
ÔÚÏߵȣ¬³ÁµÃºÃ¿ì¡£¡£¡£
dll ºÍCOM ¶¼²»ÐУ¬ÄǸöC ´úÂëÊÇÓÃÀ´¼Ó½âÃܵģ¬Èç¹ûÉú³ÉDLL ±ðÈ˾ͿÉÒÔËæ±ãµ÷ÓÃÁË¡£
C#Òªµ÷Ó÷ÇÍйÜLIBÀà¿âÖ»ÄÜͨ¹ýVC.NETÏÈ·â×°Ò»´Î¡£Ã»ÓÐÆäËüµÄ°ì·¨
·â×°³Éʲô£¿²»ÊÇDLL ¾ÍÊÇLib °É£¿£¿£¿C# ÓÖµ÷Óò»ÁËlib
ÊÔÊÔ¿´À²¡£¡£¡£
°ï¶¥¡¢¡¢¡¢
ÄãÊDz»ÊÇ¿¼ÂÇϼÓÃܵÄ˼·£¿
¶ÔDLL¿ÉÒÔ½øÐмÓÃÜ£¬²¢ÔÚÄÚ´æÖÐÕ¹¿ªÊ¹Óò»¿ÉÒÔÂð£¿
»òÕ߸ĸöÃû×Ö£¬³ýÁËÄãûÈËÖªµÀÊÇDLL......
ÕÒµ½Ò»¸öÀý×Ó£º¡¶ÈÃC++´úÂëÓëC#´úÂëÒ»ÆðÉú³ÉÒ»¸öµ¥Ò»µÄAssembly¡·
ÕâÖÖ·½·¨Ò²Ðí¿ÉÐУ¬²»¹ýÒªÏȽ«ºÃ¶à.C Îļþת³É C++ ´úÂ룬ÓÐûÓмòµ¥µÄ·½·¨£¿
//c.h
#pragma once
int sqr(int n);
//c.cpp
#include "c.h"
int sqr(int n)
{
return n*n;
}
¡¡¡¡ÎªÁËÄÜÈÃËüÓëC#¹²Í¬¹¤×÷£¬±ØÐëΪËü¼Ó¸ö.NETµÄ°ü×
Ïà¹ØÎÊ´ð£º
#include <stdio.h>
#include <graphics.h>
void main()
{
int x0,y0,x1,y1,driver,mode,i;
driver=VGA;
mode=VGAHI;
initgraph(&driver,&mode,&qu ......
±àд³ÌÐòdetab, ½«ÊäÈëÖеÄÖƱí·ûÌæ»»³ÉÊʵ±ÊýÄ¿µÄ¿Õ¸ñ£¬Ê¹¿Õ¸ñ³äÂúµ½ÏÂÒ»¸öÖƱí·ûÖÕÖ¹µÄµØ·½¡£¼ÙÉèÖƱí·ûÖÕֹλµÄλÖÃÊǹ̶¨µÄ£¬±ÈÈçÿ¸ônÁоͻá³öÏÖÒ»¸öÖƱí·ûÖÕֹλ¡£
£££££££££££££££££££ ......
ÏëÖªµÀÿÌõÖ¸Áî»òº¯ÊýµÄϵͳÏûºÄ¡£±ÈÈçϵͳִÐÐint a=0£»µÄ¿ªÏúÊǶàÉÙ¡£ÓÐûÓÐÀàËƵÄÎĵµÖ®ÀàµÄ¡£²»ÒªºÍÎÒ˵ÓÃʲôclock()º¯ÊýÀ´²âÊÔ¡£ÎÒÏëÒªÏà¹Ø×ܽáºÃµÄÎĵµ
ÏÈ·´»ã±à,È»ºóÄÃ×ÅcpuµÄÖ¸ÁîÊÖ²á²éÿÌõÖ¸ÁîµÄʱ¼äÖÜÆÚ ......
VC ++ 6.0 visual studio 2003 ÓëC ++ ÓÐʲôÇø±ð <ѧVC֮ǰһ¶¨ÒªÑ§C++Âð£¿
²»¹ýÎÒÂòµÄÊ鶼ЩºÚ¿Í±à³ÌµÄ,ºÜÉÙÌáµ½MFCµÄ,ÊéÉϵÄÔ´ÂëÄ ......