This is my first shot at creating .dlls and .cls files. I have done a number of .exe so I’m not a total newbie.
How to explain…..
My project (Call it CustomTool.vbp) has a form and a number of classes in it. The class files all have the same properties. There are private and PUBLIC properties and procedures in all of the .cls files. In fact most of the files are copies of each other with some changes in them.
Lets look at two class files. Button.cls and Tool.cls
If I go into any sub procedure in either of these files (or any of the other ones for that matter) and type in “CustomTool.” I only get the auto complete for “Button” and “form1”. And any of the sub procedures in Button and form1. I get nothing for Tool (or any of the other class files).
In fact, Button.cls and form1 are the only files seen by any of the other .cls files. I have gone so far as to copy Button into a new .cls file. But still, the only file that is ‘seen’ is the original.
Let me try to make a simple example –
Button.cls –
Public Sub dothis()
Call Tool.dothat <<<< Fails at compile with “Variable Not Defined”
Msgbox (“do this”)
End Sub
Tool.cls
Public Sub dothat()
Call Button.dothis <<<<Works fine.
MsgBox (“do that”)
End Sub
I must be doing something simple wrong, But I’m getting so I don’t see the forest, just the trees.
- Thanks
How to explain…..
My project (Call it CustomTool.vbp) has a form and a number of classes in it. The class files all have the same properties. There are private and PUBLIC properties and procedures in all of the .cls files. In fact most of the files are copies of each other with some changes in them.
Lets look at two class files. Button.cls and Tool.cls
If I go into any sub procedure in either of these files (or any of the other ones for that matter) and type in “CustomTool.” I only get the auto complete for “Button” and “form1”. And any of the sub procedures in Button and form1. I get nothing for Tool (or any of the other class files).
In fact, Button.cls and form1 are the only files seen by any of the other .cls files. I have gone so far as to copy Button into a new .cls file. But still, the only file that is ‘seen’ is the original.
Let me try to make a simple example –
Button.cls –
Public Sub dothis()
Call Tool.dothat <<<< Fails at compile with “Variable Not Defined”
Msgbox (“do this”)
End Sub
Tool.cls
Public Sub dothat()
Call Button.dothis <<<<Works fine.
MsgBox (“do that”)
End Sub
I must be doing something simple wrong, But I’m getting so I don’t see the forest, just the trees.
- Thanks