Sub New is protected in VB6 OXC

jjjamie

Active member
Joined
Aug 30, 2002
Messages
34
Location
England
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 wouldnt accept the line.

Can anyone help me as to what to do?

Thanks,

Jamie
 
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.
 
Ive tried that. VB6 doesnt understand it. I have also tried:


Public Sub Class_Initialize()

End Sub

Ive no idea at all what to do!!! :confused:
 
COM components dont have constructors. Youd be best off making your own Initialize method or something on the control.
 
Back
Top