Click to See Complete Forum and Search --> : class within a a class
dwhawley
Apr 8th, 2002, 02:16 PM
i have created a couple of classes - clsCompany and clsKeyword. clsKeyword is a collection class that should only be viewable from with clsCompany.
1.) how do i implement that?
2.) how can i pass parameters to it so that i only return the keywords that would be associated with that particular instance?
Edneeis
Apr 8th, 2002, 02:44 PM
You can make clsKeyword Public not Creatable then other applications can use it but can not make new instances of it. That way you can have the clsCompany make the instances. I'm not sure what you mean with the second question but maybe that would fix both.
dwhawley
Apr 8th, 2002, 04:36 PM
i've gotten as far as making my "Keyword" class "publicnotcreateable", but then i'm not sure exactly how to reference it from within my "company" class once i've done this. i'm a newbie to com and am having difficulty with syntax.
as far as the parameters question, i want to return only the keywords unique to that company out of a table. that would require me passing the unique id of that company to the Keyword class. can i do this?
Edneeis
Apr 8th, 2002, 09:17 PM
Well it is a little difficult to make an example without knowing more about the project but here is my attempt.
dwhawley
Apr 9th, 2002, 07:49 AM
edneeis,
thanks a lot! you're "attempt" was a lot more than the "nudge-in-the-right-direction" i was expecting to get. i'm currently reading through and trying to understand it. right off, i see you have a class for "Keyword" and a class for "Keywords". this may be the beginning of my problem. thanks for your time.
dwhawley
Edneeis
Apr 9th, 2002, 10:23 AM
No problem, let me know if I can do anything else to help and I'm glad that example helped some.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.