Results 1 to 8 of 8

Thread: DLL doesn't see itself?!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    Graduate Office (aka "Pit of Despair")
    Posts
    88

    Question DLL doesn't see itself?!

    Hrm, I'm making a really silly mistake. I've got a DLL that has several class modules. Each one contains various subs. However, one module can't seem to see another's subs, even though they're public.

    My .exe project CAN see them. But the DLL can't seem to see other subs in other class modules.

    Anyone care to enlighten the Newbie?
    - Kronix


    "I have not failed. I have merely found 10,000 ways that won't work." - Thomas Edison

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Did you declare an instance of the other class inside the class you want are accessing it from?

    All the code in the class modules still only appear when you make an object from them even within the same project. If you want to share things between them you may want to try using a standard module in the dll project.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    Graduate Office (aka "Pit of Despair")
    Posts
    88
    Hmm, let me get this straight...

    I've got a class module named 'communication' with several subs.

    If I want to use those subs in another class module, I have to reference 'communication'?

    But, instead, I could just put all my subs into a normal module, and my problems are over?

    Sigh. Thanks, Edneeis. I knew it was something silly.
    - Kronix


    "I have not failed. I have merely found 10,000 ways that won't work." - Thomas Edison

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Although keep in mind that any subs in a standard module can't be accessed from an exe that references the dll. You can either make internal version of the subs in a standard module or you can pass in an instance of the other class to any functions that need it. So say the server class gets passed a communication object for a function in order to change things in it. If you use the standard module then you have to also have a way of identifying which instance you are trying to work with so that solution is not as easy as it sounds either. It depends a lot on what you are trying to do.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    Graduate Office (aka "Pit of Despair")
    Posts
    88
    Hmm, I spoke too soon...

    Okay, I've got most of my subs moved into the right places. However, there's a sub (ClientMsg) I'd like to access both in my .exe and in my DLL. So, I keep it in the class mod, right?

    How do I reference it in another module? I keep trying something like:

    Public Msg as ClientMsg

    But that doesn't seem to work correctly. It appears I'm lacking in basic instancing understanding.
    - Kronix


    "I have not failed. I have merely found 10,000 ways that won't work." - Thomas Edison

  6. #6
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    IF you want to refrence another class you have to use the same syntax you would use if you were refrensing it from outside the DLL.

    You have 2 classes inside the same DLL CLASS1 and CLASS2

    CLASS1 wants to call a method from CLASS2.

    Insode CLASS1 you have to say

    DIM MYobj as NEW CLASS2

    Then use MYobj however you want.
    Last edited by Arc; Apr 25th, 2002 at 10:44 PM.
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


  7. #7

    Thread Starter
    Lively Member
    Join Date
    Mar 2001
    Location
    Graduate Office (aka "Pit of Despair")
    Posts
    88
    Thanks, Arc. I guess I was making it a lot more difficult than it really was. Somehow, I thought it had to be hard.
    - Kronix


    "I have not failed. I have merely found 10,000 ways that won't work." - Thomas Edison

  8. #8
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    No problemo
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


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