首页 新闻 会员 周边 捐助

大神们看下这是神马代码?

0
悬赏园豆:60 [待解决问题]

public class ScriptControlClass : IScriptControl, ScriptControl, DScriptControlSource_Event
{
public event DScriptControlSource_ErrorEventHandler DScriptControlSource_Event_Error;

public event DScriptControlSource_TimeoutEventHandler DScriptControlSource_Event_Timeout;

[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType
=MethodCodeType.Runtime), TypeLibFunc((short) 0x40), DispId(-552)]
public virtual extern void _AboutBox();
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType
=MethodCodeType.Runtime), DispId(0x7d0)]
public virtual extern void AddCode([In, MarshalAs(UnmanagedType.BStr)] string Code);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType
=MethodCodeType.Runtime), DispId(0x9c4)]
public virtual extern void AddObject([In, MarshalAs(UnmanagedType.BStr)] string Name, [In, MarshalAs(UnmanagedType.IDispatch)] object Object, [In] bool AddMembers = false);
[
return: MarshalAs(UnmanagedType.Struct)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType
=MethodCodeType.Runtime), DispId(0x7d1)]
public virtual extern object Eval([In, MarshalAs(UnmanagedType.BStr)] string Expression);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType
=MethodCodeType.Runtime), DispId(0x7d2)]
public virtual extern void ExecuteStatement([In, MarshalAs(UnmanagedType.BStr)] string Statement);
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType
=MethodCodeType.Runtime), DispId(0x9c5)]
public virtual extern void Reset();
[
return: MarshalAs(UnmanagedType.Struct)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType
=MethodCodeType.Runtime), DispId(0x7d3)]
public virtual extern object Run([In, MarshalAs(UnmanagedType.BStr)] string ProcedureName, [In, ParamArray, MarshalAs(UnmanagedType.SafeArray, SafeArraySubType=VarEnum.VT_VARIANT)] params ref object[] Parameters);

[DispId(
0x5e0)]
public virtual bool AllowUI { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5e0)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5e0)] set; }

[DispId(
0x3e8)]
public virtual object CodeObject { [return: MarshalAs(UnmanagedType.IDispatch)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x3e8)] get; }

[DispId(
0x5e3)]
public virtual MSScriptControl.Error Error { [return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5e3), TypeLibFunc((short) 0x400)] get; }

[DispId(
0x5dc)]
public virtual string Language { [return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5dc)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5dc)] set; }

[DispId(
0x5e2)]
public virtual MSScriptControl.Modules Modules { [return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), TypeLibFunc((short) 0x400), DispId(0x5e2)] get; }

[DispId(
0x5e0)]
public virtual bool MSScriptControl.IScriptControl.AllowUI { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5e0)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5e0)] set; }

[DispId(
0x3e8)]
public virtual object MSScriptControl.IScriptControl.CodeObject { [return: MarshalAs(UnmanagedType.IDispatch)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x3e8)] get; }

[DispId(
0x5e3)]
public virtual MSScriptControl.Error MSScriptControl.IScriptControl.Error { [return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5e3), TypeLibFunc((short) 0x400)] get; }

[DispId(
0x5dc)]
public virtual string MSScriptControl.IScriptControl.Language { [return: MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5dc)] get; [param: In, MarshalAs(UnmanagedType.BStr)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5dc)] set; }

[DispId(
0x5e2)]
public virtual MSScriptControl.Modules MSScriptControl.IScriptControl.Modules { [return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), TypeLibFunc((short) 0x400), DispId(0x5e2)] get; }

[DispId(
0x3e9)]
public virtual MSScriptControl.Procedures MSScriptControl.IScriptControl.Procedures { [return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x3e9)] get; }

[DispId(
0x5de)]
public virtual int MSScriptControl.IScriptControl.SitehWnd { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), TypeLibFunc((short) 0x400), DispId(0x5de)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5de), TypeLibFunc((short) 0x400)] set; }

[DispId(
0x5dd)]
public virtual ScriptControlStates MSScriptControl.IScriptControl.State { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5dd), TypeLibFunc((short) 0x400)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5dd), TypeLibFunc((short) 0x400)] set; }

[DispId(
0x5df)]
public virtual int MSScriptControl.IScriptControl.Timeout { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5df)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5df)] set; }

[DispId(
0x5e1)]
public virtual bool MSScriptControl.IScriptControl.UseSafeSubset { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5e1)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5e1)] set; }

[DispId(
0x3e9)]
public virtual MSScriptControl.Procedures Procedures { [return: MarshalAs(UnmanagedType.Interface)] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x3e9)] get; }

[DispId(
0x5de)]
public virtual int SitehWnd { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), TypeLibFunc((short) 0x400), DispId(0x5de)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5de), TypeLibFunc((short) 0x400)] set; }

[DispId(
0x5dd)]
public virtual ScriptControlStates State { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5dd), TypeLibFunc((short) 0x400)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5dd), TypeLibFunc((short) 0x400)] set; }

[DispId(
0x5df)]
public virtual int Timeout { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5df)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5df)] set; }

[DispId(
0x5e1)]
public virtual bool UseSafeSubset { [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5e1)] get; [param: In] [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), DispId(0x5e1)] set; }
}

 

为什么这么写?怎么查dispid和Guid

解释下这是什么意思

[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), TypeLibFunc((short) 0x40), DispId(-552)]

谢谢!!!!!!!!!!!!!!!!!!!!!!!

三流老码农的主页 三流老码农 | 初学一级 | 园豆:135
提问于:2011-01-17 17:38
< >
分享
所有回答(3)
0

看着好像是C#代码,

[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime), TypeLibFunc((short) 0x40), DispId(-552)]

这个应该叫“特性属性”?

顾晓北 | 园豆:10898 (专家六级) | 2011-01-17 17:59
对是c#,是一个模板引擎的代码,我看了半天不懂
支持(0) 反对(0) 三流老码农 | 园豆:135 (初学一级) | 2011-01-18 09:05
暂时还是不要研究这些东西吧?
支持(0) 反对(0) 顾晓北 | 园豆:10898 (专家六级) | 2011-01-18 09:07
0

.NET内核原生实现的函数,引用进类库里来

钧梓昊逑 | 园豆:945 (小虾三级) | 2011-01-17 20:46

请问您知道怎么找到这些extern定义的方法的实现在哪儿吗?

支持(0) 反对(0) Jessie.M | 园豆:181 (初学一级) | 2012-01-18 16:21
0

c#代码

上面的代码中 dispid和Guid 都是和com打交道的时候要用到的

MarshalAs封装了一些对内存的操作  今天和非托管代码打交道的时候用到

听说读写 | 园豆:777 (小虾三级) | 2011-01-18 16:51
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册