1
votes

I have a winforms control written in vb.net for VB6 program. The control is dynamically added to the VB6 control controls collection.

Set ctrlVB6 = Controls.Add("NETNamespace.SelVB6", "SelNet")

If the .net class (SelVB6) has all necessary properties the Add method returns VB6 control wrapper and control is visible. Otherwise Add method returns nothing and control is not available in VB6.
The .net class is derived from System.Windows.Forms.UserControl, which (luckily) has all required properties. The .net class is decorated with ClassInterface attribute to garantee that properties are available to COM.

<ClassInterface(ClassInterfaceType.AutoDual)>
Public Class SelVB6

Everything works, but not all properties of System.Windows.Forms.UserControl are com visible and lots of warnings are generated in VS2010. To get rid of warnings I need to know which properties are necessary, define an interface and use ClassInterfaceType.None.

Notes

I am not allowed to use Interop Forms Toolkit.
I know that I can list control properties Control Properties in Visual Basic 6.

Warning example:

Type library exporter warning processing 'NETNamespace.SelVB6.PreProcessControlMessage(#0)'. Warning: Non COM visible value type 'System.Windows.Forms.PreProcessControlState' is being referenced either from the type currently being exported or from one of its base types. Microsoft.Common.targets

1
It's not just the properties that make it a control, it's deriving from one of the Control classes. Fixing your properties not showing up and the warnings depends on what the actual warnings are.Deanna
I think than vb6 over com does not evaluate .net inheritance. I have added warning example.IvanH
Those warnings are normal, most .NET objects are not exposed to COM, only those required to actually implement the correct interface.Deanna
Yes, I know they are normal. And also everything works. But I don't like them. So I am looking a way to exclude the not COM visible properties out of interface. So I need to know minimal set of properties which the interface should include.IvanH

1 Answers

0
votes

Just copy the warnings out and bring them into something like Notepad++. Then you can quickly do up a macro and filter it out so you isolate all the functions that need to be declared. Then just declare them real quick.