COM InterOp中的数据类型'long'(Int64)

时间:2015-10-28 08:53:45

标签: c# web-services vb6 interop

我在C#中为VB6制作代理类。代理服务器用于第三方Web服务。 webservice的属性定义为'long'(Int64),VB6不支持。我为每个'long'属性定义了额外的'对象'属性,这将是VB6中的变体类型。这是正确的做法吗?

[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
[ComVisible(true)]
public interface IWSInterface
{
    [ComVisible(false)]
    long Value { get; set; }
    [DispId(1)]
    object Value_ { get; }
}
[ClassInterface(ClassInterfaceType.None)]
[ComVisible(true)]
public partial class WSClass : IWSInterface
{
    //Interface is implemented in imported wsdl class (Reference.cs)

    object IWSInterface.Value_
    {
        get
        {
            return this.Value;
        }
    }
}

编辑:更改为'字符串'修复了“问题”,但必须更改一些自动生成的代码。

0 个答案:

没有答案