锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美大片一区二区,日本高清久久一区二区三区,最新地址在线观看http://www.aygfsteel.com/Titan/articles/30299.htmlTitanTitanSat, 11 Feb 2006 14:22:00 GMThttp://www.aygfsteel.com/Titan/articles/30299.htmlhttp://www.aygfsteel.com/Titan/comments/30299.htmlhttp://www.aygfsteel.com/Titan/articles/30299.html#Feedback0http://www.aygfsteel.com/Titan/comments/commentRss/30299.htmlhttp://www.aygfsteel.com/Titan/services/trackbacks/30299.html浣跨敤C#鏃朵笉鍏嶇敤璋冪敤鍒殑DLL錛屽WIN32鐨凙PI鍜岃嚜宸變互鍓嶅仛鐨凞LL錛?
C#璋冪敤DLL寰堝儚VB錛屼笅闈㈣璁虹殑C#璋冪敤DLL鐨勬柟寮忋?
鐪嬬湅涓嬮潰鐨勪緥瀛愶紝婕旂ず浜嗘庝箞瀹氫箟DLL鍑芥暟鎺ュ彛
public class Utility
{
   [DllImport("kernel32",
EntryPoint=鈥滳reateDirectory鈥?
CallingConvention=CallingConvention.StdCall]
   public static extern bool Create (string name);
  
   [DllImport("User32"]
EntryPoint=鈥滿essageBox鈥?
CallingConvention=CallingConvention.StdCall]
   public static extern int MsgBox (string msg);
}
  
class MyClass
{
   public static int Main()
   {
      string myString;
      Console.Write("Enter your message: ");
      myString = Console.ReadLine();
      return Utility.MsgBox(myString);
   }
}
  
鍊煎緱娉ㄦ剰鐨勬槸錛岀己鐪佺殑璋冪敤瑙勫垯(CallingConvention)鏄疭tdcall錛屽悓Winapi錛屽湪
C++閲屾槸__stdcall鐨勫艦寮忥紝鍑芥暟鍏ュ彛(EntryPoint)緙虹渷鏄悓鍚嶏紝濡侰reateDirectory
鐨勫畾涔変篃鍙互涓?
   [DllImport("kernel32")]
   static extern bool CreateDirectory(string name, SecurityAttributes sa);
  
WIN32 API鍘熷瀷涓?
BOOL CreateDirectory(
  LPCTSTR lpPathName,                         // directory name
  LPSECURITY_ATTRIBUTES lpSecurityAttributes  // SD
);
  
鍦ㄨ皟鐢╓IN32 API鏃舵敞鎰忛偅浜涚被鍨嬬殑杞崲錛屽緇撴瀯(struct)銆佹寚閽?pointer)錛?

鏈夊叧鍚勭璇█涔嬮棿綾誨瀷杞崲鍜孌llImport灞炴х殑璇︾粏淇℃伅鍙互鍙傝僑DK鏂囨。 

Titan 2006-02-11 22:22 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 隆德县| 安康市| 剑河县| 阳信县| 亳州市| 霍林郭勒市| 郸城县| 卢龙县| 南昌市| 毕节市| 鄂温| 读书| 芜湖县| 晋江市| 泉州市| 马鞍山市| 金门县| 洮南市| 新巴尔虎左旗| 嘉鱼县| 筠连县| 威远县| 玉环县| 木兰县| 会同县| 阳谷县| 东乡县| 拜泉县| 共和县| 随州市| 林口县| 简阳市| 大港区| 运城市| 会泽县| 诸城市| 青神县| 石河子市| 阿巴嘎旗| 含山县| 上虞市|