开发者

C#, VB6 and the Decimal data type

开发者 https://www.devze.com 2022-12-16 14:44 出处:网络
Im writing a C# class library which is going to be used as a proxy between a VB6 application and WCF service.

Im writing a C# class library which is going to be used as a proxy between a VB6 application and WCF service.

Some of the WCF service methods use Decimal data types as parameters 开发者_开发问答which Im unable to duplicate directly in the interface I provide to the VB6 application as this is an unsupported type.

How do I implement this in the COM interface and safely convert it to the Decimal type that the WCF interface is expecting?


Decimal is available in VB6 as a subtype of VARIANT.

  Dim d As Variant

  d = CDec(1)

  MsgBox TypeName(d)

You therefore implement it as a VARIANT with appropriate subtype in the interface.

0

精彩评论

暂无评论...
验证码 换一张
取 消