|
-
Feb 4th, 2008, 07:27 AM
#1
[RESOLVED] CallByName
I have:
- Form1
- Class1 (with method Test)
In Form1, i have declared:
Code:
Private x As Class1
Now, i want to use CallByName from another module, to call Test from Class1. E.g.:
Code:
CallByName Form1, "x.Test", vbMethod
But it doesn't go that easy Is there any solution to my problem?
Thanx!
-gav
-
Feb 4th, 2008, 07:36 AM
#2
Re: CallByName
Code:
CallByName Form1.X, "Test", vbMethod
Remember to initialize X before calling CallByName.
-
Feb 4th, 2008, 07:38 AM
#3
Re: CallByName
@Merri: is there any solution that "keeps" x Private?
-
Feb 4th, 2008, 08:05 AM
#4
Re: CallByName
Besides dirty hacking that involves extra coding, thus not being not really worth it, no. CallByName can't call Private features because it can't see them because they are, you guessed it, private. And thus hidden. You can't call what you can't see.
-
Feb 4th, 2008, 08:33 AM
#5
Re: CallByName
 Originally Posted by Merri
Besides dirty hacking that involves extra coding, thus not being not really worth it, no. CallByName can't call Private features because it can't see them because they are, you guessed it, private. And thus hidden. You can't call what you can't see.
If you have a private function and a regular call to that function in the same module then you can call that private function. But if you have a private function and a CallByName in the same module you cannot call that function so it appears that the reason goes beyond the mear fact that it is a private function.
-
Feb 4th, 2008, 09:07 AM
#6
Re: CallByName
Thanks. I'll make em' Public.
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
|