Click here to Skip to main content
15,890,845 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I've re-developed a ActiveX control in C# (basically a drop-in replacement for a age-old VB6 control). Most things work, however, I need to implement property data binding for it.


In VB6, that was an easy thing to do, thanks to the dialog here: Binding a Control to a Data Source. Simply checking the first 3 options in "Data Binding" would do the trick, and COM-aware applications could bind data to the control.


A similar problem has surfaced already, it seems, with quite a complicated workaround:

You might have to reverse engineer some of the generated code to do this. Offhand, I would create the TLB file, and then use OLEVIEW to view
the IDL.

Then, I would copy and paste the IDL into a new file, and add the
bindable attribute to the idl in the appropriate places. Once that is done,
I would run that IDL file through MIDL, and create a type library. Once you
do that, you should be able to register that type library to create your
CCW's.


It seems there is no facility in .NET to add the [bindable] attribute to a COM class.

Please, any help with this would be greatly appreciated!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900