Results 1 to 3 of 3

Thread: Passing a private class reference

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    I'm in front of the computer.
    Posts
    270

    Exclamation Passing a private class reference

    Okay, my problem is kind of hard to explain, so hopefully this will make sense.

    I'm making a DLL containing classes that will be used as a database system. The internal, core class is private, and not visible to the user of the DLL. This is because I can't hide everything that I need to hide with only one layer of public/private stuff without disabling VB's automatic detection of what to expect as a return from procedures. If that didn't make sense, ignore it, cause its not really a part of the problem.

    Apart from this class, there are four others. 3 are public not creatable, and are used as helpers for the only public one, so that I can do something like Database.Records(i).IDCode or somesuch, where database if the public class, and records is an instance of one of the other classes.

    My problem is this: I need to pass the private reference of the core class from the master public class to the other public not creatable classes, and I'd really like to do it without making a sub viewable to the user of the DLL. What I'd really LIKE to do is be able to do is alter the public not creatable classes to have a custom constructor the way I would be able to in C++. Is there a way I can do this, or is there another way to solve the problem?
    Alphanos

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    I'm not sure I understand the situation correctly, but if I do you should be able to use te Friend statement instead of Public/Private. Friend is for use in class modules were it makes it public to other items in the same project (like for a dll the dll project) but private to anything else (like the program calling the dll).

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    I'm in front of the computer.
    Posts
    270
    LOL, Thanks! I had just been thinking when typing the post that it would simplify things if I could make the class modules friends... that's exactly what I was looking for, I didn't know that that statement existed in VB.
    Alphanos

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width