-
Hi,
I'm working on this program that uses plugins. I want declare and use my own publc type but I can't get it to work.
Take a look at it
Code:
Modulue1.bas
'Used to Sore Info about The Aothor of the Plugins
Public Type PLUGIN_AUTHOR
Author_Name As String
Author_Email As String
Author_Homepage As String
End Type
Code:
Plugins.cls
'This is The Plugin Class
'local variable(s) to hold property value(s)
Private mvarmnm As PLUGIN_AUTHOR 'local copy
Public Property Set Plugs(ByVal vData As PLUGIN_AUTHOR)
'used when assigning an Object to the property, on the left side of a Set statement.
'Syntax: Set x.mnm = Form1
Set mvarmnm = vData
End Property
Public Property Get Plugs() As PLUGIN_AUTHOR
'used when retrieving value of a property, on the right side of an assignment.
'Syntax: Debug.Print X.mnm
Set Plugs = mvarmnm
End Property
I keep getting a Compiler error, any suggestions?
[Edited by omarswan on 05-26-2000 at 07:26 PM]
-
I think you have to convert your UDT to a classmodule, I've always wished there was another way.
-
Here is a trick:
VB will not allow you to use User Types as public in class module or pass them as parameters for functions declared on module level.
To play it around use Fried instead of public for function or properties. Theoreticaly it is not correct, but it works all right.
-
Any more suggestions
-
What is wrong with Friend?
-
And UDT are not objects so:Plugins.cls
'This is The Plugin Class
'local variable(s) to hold property value(s)
Private mvarmnm As PLUGIN_AUTHOR 'local copy
Friend Property Let Plugs(ByVal vData As PLUGIN_AUTHOR)
mvarmnm = vData
End Property
Friend Property Get Plugs() As PLUGIN_AUTHOR
Plugs = mvarmnm
End Property
This will work.