Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C#, VB6 and the Decimal data type

Tags:

c#

interop

vb6

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?

like image 604
Andrew Avatar asked Jan 18 '10 15:01

Andrew


People also ask

What C is used for?

C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...

What is C full form?

Originally Answered: What is the full form of C ? C - Compiler . C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell Labs. C was originally first implemented on the DEC PDP-11 computer in 1972.

What is C language?

C is an imperative procedural language supporting structured programming, lexical variable scope, and recursion, with a static type system. It was designed to be compiled to provide low-level access to memory and language constructs that map efficiently to machine instructions, all with minimal runtime support.

How old is the letter C?

The letter c was applied by French orthographists in the 12th century to represent the sound ts in English, and this sound developed into the simpler sibilant s.


1 Answers

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.

like image 86
GSerg Avatar answered Oct 11 '22 20:10

GSerg