|
-
Apr 25th, 2002, 05:20 PM
#1
Thread Starter
Lively Member
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
-
Apr 25th, 2002, 05:29 PM
#2
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.
-
Apr 25th, 2002, 05:33 PM
#3
Thread Starter
Lively Member
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
-
Apr 25th, 2002, 06:14 PM
#4
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.
-
Apr 25th, 2002, 10:01 PM
#5
Thread Starter
Lively Member
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
-
Apr 25th, 2002, 10:38 PM
#6
PowerPoster
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.

-
Apr 25th, 2002, 10:50 PM
#7
Thread Starter
Lively Member
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
-
Apr 25th, 2002, 11:31 PM
#8
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|