(36)C# COM交互

 平台调用

 

调用DLL

 

[DllImport("standerMFC.dll")]
    public static extern  int PReadUID(ref HHFC_SET stru);

 

[AttributeUsage(AttributeTargets.Method)]  
public class DllImportAttribute: System.Attribute  
{  
    public DllImportAttribute(string dllName) {…} //定位参数为dllName  
    public CallingConvention CallingConvention; //入口点调用约定  
    public CharSet CharSet;                                   //入口点采用的字符接  
    public string EntryPoint;  //入口点名称  
    public bool ExactSpelling;   //是否必须与指示的入口点拼写完全一致,默认false  
    public bool PreserveSig;  //方法的签名是被保留还是被转换  
    public bool SetLastError;  //FindLastError方法的返回值保存在这里  
    public string Value { get {…} }  
}

 

posted @ 2017-03-31 08:33  富坚老贼  阅读(237)  评论(0编辑  收藏  举报