How to pass long groups from VB6 to C # to COM

I need to pass an int or long array (not important) from a VB6 application to the C# COM Visible class. I have tried declaring the interface in C# like this:

< /p>

void Subscribe([MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_I4)]int[] notificationTypes)

void Subscribe(int[] notificationTypes )

But they all raise Function or interface tags as restricted, or the function uses Automation type that is not supported in Visual Basic.

How do I declare C# methods?

If you are desperate, please write a signature in the virtual VB6 ActiveX DLL project. Then through Visual Studio or The command line tool generates the .NET Interop version of the vb6 component. Then use Reflector or dotPeek to pull the code out of the interop assembly. This is a long process, but it works.

I Need to pass an int or long array (not important) from the VB6 application to the C# COM Visible class. I have tried declaring the interface in C# like this:

void Subscribe([MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_I4)]int[] notificationTypes)

void Subscribe(int[] notificationTypes)

But they will all Function or interface tag is raised as restricted, or the function uses Automation type that is not supported in Visual Basic.

How do I declare a C# method?

If you are desperate, please write a signature in the virtual VB6 ActiveX DLL project. Then generate the .NET Interop version of the vb6 component through Visual Studio or command line tools. Then use Reflector or dotPeek to pull the code out of the interop assembly. This is a long process, but it works.

Leave a Comment

Your email address will not be published.