2010年9月13日

extern dllInport用法

摘要: extern 修饰符用于声明在外部实现的方法。extern 修饰符的常见用法是在使用 Interop 服务调入非托管代码时与 DllImport 属性一起使用。在这种情况下,还必须将方法声明为 static。下面的代码示例演示如何使用 DllImportAttribute 属性(EntryPoint 属性)导入 Win32 MessageBox 函数,并改名为NewMessageBox。 然后,代码示例将调用导入的方法。 [DllImport("user32.dll", CharSet = CharSet.Unicode,EntryPoint="MessageBo 阅读全文

posted @ 2010-09-13 10:26 源远流长 阅读(171) 评论(0) 推荐(0) 编辑

创建新的Exception

摘要: namespace MEDAdapter{ [global::System.Serializable] public class ServiceConfigException : Exception { // // For guidelines regarding the creation of new exception types, see // http://msdn.microsoft.com/library/default.asp?url=/library/en- us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp // 阅读全文

posted @ 2010-09-13 08:57 源远流长 阅读(185) 评论(0) 推荐(0) 编辑

导航