小编Eri*_*oix的帖子

如何从C#.NET COM中引发Exception

如何从C#.NET COM中引发异常.事实上,我在使用Borland Delphi 7.0的Win32应用程序构建中,我尝试在.NET中使用一个函数.一切都工作得很好,除了在C#中引发异常的事实没有重新路由到Delphi,我想我想念某种方法装饰器.这里有一段代码:

void iLinkV2.FindLinkedClientEng(string SourceApp, string SourceClientID,
     ref object ClientID, ref object Engagement)
{
    throw new COMException("errClientNotFound",
        (int)ExceptionsType.errClientNotFound);
    ClientID  = SourceClientID; 
}

[ComVisible(true),
 Guid("D731C821-EEA2-446E-BC5A-441DCA0477F5"),
 InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface iLinkV2
{ ...
}
Run Code Online (Sandbox Code Playgroud)

c# delphi com delphi-7

3
推荐指数
1
解决办法
672
查看次数

标签 统计

c# ×1

com ×1

delphi ×1

delphi-7 ×1