I am making an application that comments on vb6 using a cryptographic shell. The .net and interop part, so far, is in order, fully working.
Since my client is testing it, I have a quick question:
[ComVisible(true)] public SomeObjectComVisible GetThat(byte[] array){ ... }
I have used so far the types that I have shown com or int and string, and no problem so far.
Is it possible to use (.net) byte
or use *char
?
When I note that the assembly is visible and registered in com interop, does it create a wrapper for it or do I need to use some unmanaged type?
Ah, this is vb6, not vbscript.
thanks a million
for those looking for an answer:
public SomeObjectComVisible GetThat([MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_UI1)]byte[] array)
the problem is arrays. http://msdn.microsoft.com/en-us/library/z6cfh6e6.aspx and also http://msdn.microsoft.com/en-us/library/75dwhxf7.aspx
Any non-flying type can be a daunting task. You can specify your own types to be used, you just need to use
[ComVisible(true), ClassInterface(ClassInterfaceType.None), ProgId("SomeNamespace.SomeClass"), Guid("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")]
on top of the class
Thank you all.
Great help
source share