青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

隨筆 - 42  文章 - 3  trackbacks - 0
<2009年10月>
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

常用鏈接

留言簿(2)

隨筆檔案

文章檔案

網(wǎng)頁收藏

搜索

  •  

最新評論

閱讀排行榜

評論排行榜


This note is about book .NET and COM.

Think of XML Web services simply as components or Application Programming Interfaces (APIs) exposed on a Web site rather than a DLL residing on your own computer.

An assembly is a self-describing logical component. Assemblies are units of deployment, units of security, units of versioning, and units of scope for the types contained within. Although an assembly is typically one executable or one DLL, it could be made up of multiple files. 

Any assemblies with type definitions contain corresponding type information describing them. This information is called metadata (data about data). 

Reflection
 is the process of programmatically obtaining type information. Programs can dynamically inspect (“reflect upon”) the metadata for any assemblies, dynamically instantiate objects and invoke members, and even emit metadata dynamically (a technology called Refection Emit). Reflection provides late binding facilities like COM’s IDispatch and IDispatchEx interfaces, type inspection like COM’s ITypeInfo and ITypeInfo2 interfaces, and much more.

How Unmanaged Code Interacts with Managed Code

Three technologies exist that enable the interaction between unmanaged and managed code:

  • Platform Invocation Services (PInvoke)

     1 static class GameSharp
     2 {
     3     /// The native methods in the DLL's unmanaged code.
     4     internal static class UnsafeNativeMethods
     5     {
     6     const string _dllLocation = "CoreDLL.dll";
     7     [DllImport(_dllLocation)]
     8     public static extern void SimulateGameDLL(int a, int b);
     9     }
    10 }

    Choosing a Calling Convention

    The calling convention of an entry point can be specified using another DllImportAttribute named parameter, called CallingConvention. The choices for this are as follows:

    • CallingConvention.Cdecl. The caller is responsible for cleaning the stack. Therefore, this calling convention is appropriate for methods that accept a variable number of parameters (like printf).

    • CallingConvention.FastCall. This is not supported by version 1.0 of the .NET Framework.

    • CallingConvention.StdCall. This is the default convention for PInvoke methods running on Windows. The callee is responsible for cleaning the stack.

    • CallingConvention.ThisCall. This is used for calling unmanaged methods defined on a class. All but the first parameter is pushed on the stack since the first parameter is the this pointer, stored in the ECX register.

    • CallingConvention.Winapi. This isn’t a real calling convention, but rather indicates to use the default calling convention for the current platform. On Windows (but not Windows CE), the default calling convention is StdCall.

    Declare always uses Winapi, and the default for DllImportAttribute is also Winapi. As you might guess, this is the calling convention used by Win32 APIs, so this setting doesn’t need to be used in this chapter’s examples.

     1 using System;
     2 using System.Runtime.InteropServices;
     3 
     4 public class LibWrap
     5 {
     6 // C# doesn't support varargs so all arguments must be explicitly defined. 
     7 // CallingConvention.Cdecl must be used since the stack is  
     8 // cleaned up by the caller. 
     9 
    10 // int printf( const char *format [, argument] )
    11 
    12 [DllImport("msvcrt.dll", CharSet=CharSet.Unicode, CallingConvention=CallingConvention.Cdecl)]
    13 public static extern int printf(String format, int i, double d); 
    14 
    15 [DllImport("msvcrt.dll", CharSet=CharSet.Unicode, CallingConvention=CallingConvention.Cdecl)]
    16 public static extern int printf(String format, int i, String s); 
    17 }
    18 
    19 public class App
    20 {
    21     public static void Main()
    22     {
    23         LibWrap.printf("\nPrint params: %i %f", 99, 99.99);
    24         LibWrap.printf("\nPrint params: %i %s", 99, "abcd");
    25     }
    26 }
  • Mixed-Mode Programming Using Managed Extensions to C++

  • COM Interoperability

         

      Good COM server implementation in C#

      Building COM Objects in C#

     Building COM Servers in .NET








posted on 2013-06-27 03:32 鷹擊長空 閱讀(344) 評論(0)  編輯 收藏 引用

只有注冊用戶登錄后才能發(fā)表評論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            国产精品hd| 亚洲精品国产欧美| 国产午夜一区二区三区| 国产精品高清一区二区三区| 欧美成人精品激情在线观看 | 亚洲欧美日韩精品综合在线观看 | 日韩亚洲一区在线播放| 99热在线精品观看| 亚洲一区免费| 久久青草久久| 欧美日韩在线精品| 国产一区二区三区在线观看免费视频| 禁断一区二区三区在线 | 久久大逼视频| 久久综合五月天婷婷伊人| 欧美 日韩 国产一区二区在线视频| 欧美激情一区二区三区四区 | 欧美freesex交免费视频| 欧美国产日韩一区二区三区| 欧美午夜免费电影| 亚洲高清二区| 性做久久久久久免费观看欧美| 久久综合亚州| 一本一道久久综合狠狠老精东影业 | 亚洲缚视频在线观看| 一本一本a久久| 久久久五月天| 国产精品久久久久久久第一福利| 国产专区一区| 亚洲淫片在线视频| 欧美国产日韩一区二区在线观看| 一本到高清视频免费精品| 欧美在线观看一区| 国产精品精品视频| 亚洲精品久久嫩草网站秘色| 欧美一区免费视频| 99精品视频免费观看视频| 久久免费视频观看| 国产日韩欧美一区| 亚洲欧美另类久久久精品2019| 蜜臀av性久久久久蜜臀aⅴ四虎 | 久久久久成人精品| 亚洲欧洲日本mm| 久久久在线视频| 国产精品日本一区二区| 亚洲作爱视频| 亚洲福利小视频| 久久久精品国产99久久精品芒果| 国产精品国产三级欧美二区| 99成人在线| 欧美韩日视频| 久久免费偷拍视频| 国精品一区二区三区| 欧美专区第一页| 午夜精品视频在线| 国产日韩欧美a| 欧美在线三级| 欧美亚洲一区二区在线| 国产欧美一区二区精品忘忧草| 亚洲午夜一区二区三区| 日韩视频免费大全中文字幕| 欧美激情一区二区三区在线视频| 亚洲国产精品成人精品| 免费高清在线视频一区·| 久久久久久一区二区三区| 黄色在线一区| 欧美成人高清| 欧美高清一区| 一区二区三区www| 亚洲作爱视频| 国产精品免费aⅴ片在线观看| 亚洲欧美日韩成人| 欧美亚洲在线| 亚洲第一精品福利| 亚洲经典三级| 国产精品久久久久久久一区探花| 欧美在线网站| 麻豆av福利av久久av| 日韩亚洲视频| 亚洲欧美另类国产| 136国产福利精品导航网址应用| 欧美高清一区| 欧美视频免费在线| 久久精品中文字幕一区| 欧美成人免费观看| 香蕉乱码成人久久天堂爱免费| 亚欧成人在线| 亚洲看片免费| 亚洲欧美精品| 亚洲美女精品一区| 午夜国产精品影院在线观看| 亚洲国产成人在线播放| 一区二区三区国产精品| 国内精品亚洲| 99视频国产精品免费观看| 国产在线不卡精品| 日韩视频永久免费观看| 国产一区三区三区| 99国产精品久久久久老师| 国产亚洲激情| 日韩一级黄色av| 国产精品久久久久久久9999| 久久日韩粉嫩一区二区三区| 99精品视频一区二区三区| 亚洲视频欧美在线| 亚洲国产成人在线| 午夜久久美女| 在线中文字幕日韩| 美女网站在线免费欧美精品| 欧美在线视频一区| 国产精品扒开腿爽爽爽视频| 亚洲大片精品永久免费| 激情六月综合| 午夜精品亚洲| 午夜视频在线观看一区二区| 欧美极品欧美精品欧美视频| 久久伊人精品天天| 国产日韩欧美在线| 亚洲永久在线观看| 亚洲午夜视频在线观看| 欧美精品一区二| 亚洲第一页中文字幕| 亚洲成在线观看| 久久国产欧美| 久久久国产精品亚洲一区| 国产精品毛片a∨一区二区三区| 亚洲区在线播放| 亚洲精品美女在线观看| 免费观看一级特黄欧美大片| 免费成人你懂的| 在线日韩视频| 欧美77777| 亚洲国产日韩欧美在线图片| 亚洲黄页一区| 欧美精品一卡| 日韩午夜剧场| 亚洲午夜女主播在线直播| 欧美精品三区| 日韩天堂av| 亚洲天堂成人| 国产精品视频一二三| 亚洲综合电影| 久久久久一区二区三区| 国产一区二区在线观看免费播放| 亚洲欧美激情诱惑| 久久精品国产亚洲精品| 黄色成人小视频| 免费观看成人www动漫视频| 亚洲高清视频在线| 中国成人黄色视屏| 国产精品免费福利| 久久久久久久久久久久久女国产乱| 老司机免费视频一区二区| 91久久国产综合久久| 欧美日韩三级视频| 午夜视频一区| 亚洲电影免费在线 | 亚洲日本va午夜在线电影| 欧美黄色成人网| 中文在线资源观看视频网站免费不卡| 亚洲欧美在线看| 伊人久久亚洲热| 欧美日韩另类在线| 午夜宅男久久久| 欧美激情久久久| 亚洲综合日韩中文字幕v在线| 国产日韩欧美综合一区| 久久综合电影| 亚洲天堂成人在线视频| 一区二区三区日韩精品视频| 午夜欧美不卡精品aaaaa| 国产美女精品人人做人人爽| 久久久久久久性| 一区二区三区产品免费精品久久75| 欧美在线高清视频| 亚洲日本va午夜在线影院| 国产欧美精品日韩| 欧美精品首页| 欧美一区二区私人影院日本| 亚洲久久一区| 免费一区视频| 欧美在线亚洲| 在线综合欧美| 亚洲精品国产欧美| 国内一区二区三区| 国产精品hd| 欧美精品国产一区二区| 久久久久一区二区| 亚洲欧美国产制服动漫| 亚洲精品四区| 亚洲国产日韩欧美| 免费久久精品视频| 久久国产精品久久久久久电车| 一区二区三区视频免费在线观看 | 欧美国产精品久久| 久久av资源网站| 亚洲欧美日韩中文在线制服| av成人手机在线| 亚洲精品一区二区三区樱花| 欧美jizzhd精品欧美喷水 |