Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interface Limitations in VB6

I'm trying to implement (i.e. implement an interface) a class in VB 6, but I'm getting this error: "Compile Error: Bad interface for Implements: Interface contains data fields". So I'm wondering if there are any limitations on which class you can implement? Or if anyone know why I'm getting this specific error, that would be helpful as well.

Let me know if I need to be more clear. Thanks guys.

Dave

like image 581
Perishable Dave Avatar asked Dec 07 '10 21:12

Perishable Dave


1 Answers

Interfaces in VB6 can only include methods, not member variables.

You can simulate a member variable by implementing a property method (with let and get functions).

like image 54
Joel Spolsky Avatar answered Sep 22 '22 09:09

Joel Spolsky