C #, VB6 and decimal data type

I am writing a C # class library that will be used as a proxy between a VB6 application and a WCF service.

Some of the WCF service methods use decimal data types as parameters that Im have not been able to duplicate directly in the interface that I am providing the VB6 application, since it is an unsupported type.

How to implement this in the COM interface and safely convert it to the decimal type that the WCF interface expects?

+6
c # vb6 interop
source share
1 answer

Decimal is available in VB6 as a subtype of VARIANT .

  Dim d As Variant d = CDec(1) MsgBox TypeName(d) 

Therefore, you implement it as VARIANT with the corresponding subtype in the interface.

+8
source share

All Articles