I have a DLL programmed in C# which I am converting into a COM object for use in a VB6 application. Have have several methods and properties defined as long
type which, when accessed in VB6, end up showing as "Unsupported variant type." Then I noticed that a function which is defined in C# as:
void Load(long firstNumber, int firstCheckDigit, long lastNumber , int lastCheckDigit)
Shows in my VB6 Object Browser as:
Sub Load(firstNumber As <Unsupported variant type>, firstCheckDigit As Long, lastNumber As <Unsupported variant type>, lastCheckDigit As Long)
Obviously, something about this conversion is turning the C# int
type into a VB6 Long
type which isn't a problem for me. However, I do need the firstNumber
and lastNumber
variables to be long
both in C# and VB6. The variables on the backend cannot be int
because of the size of some values being entered. Is there any way to do this? Or is a long type from the DLL side incompatible with COM objects?
Int
means different things in .NET (32bit) and VB6 (16bit). So C#'s Int becomes VB6 Long (which is 32bit). There's no analogue for .NETLong
(64bit) in VB6 - do you really need this precision? – Yuriy Galanter