jjjamie Posted April 16, 2003 Posted April 16, 2003 Hi, I am trying to use a VB6 OCX file in .NET but when I try to create the object in .NET it says: 'Private Sub New()' is not accessible in this context because it is 'Private' The first thing I checked in the VB6 file was whether there was a Private Sub New, but there was no Sub New at all. I then tried adding a Sub New, but VB wouldn't accept the line. Can anyone help me as to what to do? Thanks, Jamie Quote
hitechoutlaw Posted April 16, 2003 Posted April 16, 2003 i dont know what u are trying to do but u could do: Public Sub New() i duno if that will work for what u are doing or if u have tried it already. Quote
jjjamie Posted April 16, 2003 Author Posted April 16, 2003 I've tried that. VB6 doesn't understand it. I have also tried: Public Sub Class_Initialize() End Sub I've no idea at all what to do!!! :confused: Quote
jjjamie Posted April 16, 2003 Author Posted April 16, 2003 How do I add a Sub New to a OCX component so that I can initialise it in .NET?! :-\ Quote
*Gurus* divil Posted April 17, 2003 *Gurus* Posted April 17, 2003 COM components don't have constructors. You'd be best off making your own Initialize method or something on the control. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts