Link to home
Start Free TrialLog in
Avatar of Firlefanz
Firlefanz

asked on

DLL methods (public)

Hi!

I made myself a dll. Then I copied it into the folder of my project.
When I am working in my project and wirte down the name of the dll, followed by a dot (.),
I cannot see the public methods of my DLL.

Why can't I see the public methods I of my DLL in my project?

Please help me, thanks in advance
Avatar of Jonyv
Jonyv

I think you need to be a little more specific here. What type of DLL are you talking about? Is it an ActiveX/COM DLL? In that case you have to add a reference to it in your project to be able see your methods. Go to "Project" -> "References" , press the "Browse" button and select your DLL. Then you should be able to see it in the object browser.

If it's a regular DLL that just exports some functions you need to use the "Declare" statement in VB to get access to them, check the MSDN help for more info on that
Avatar of Firlefanz

ASKER

It is a standard classlibrary, and ever function and sub is declared as public.

I can use my DLL and it's public methods, I just cannot see them.
If my DLL had the name Worktime, in my project I write:

worktime.

and then a combo should open with all public methods, but the only item in the combo is: "gettype".
My program seems to know my DLL and I can use public methods of it, but I cannot see them in my project!

Big problem for me, everytime I have to open a second windows, load the source of my DLL an watch the methods.
If I call the method from my program then, this works. But I cannot see it, why???
ASKER CERTIFIED SOLUTION
Avatar of avya2k
avya2k

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
if it is not ActiveX dll then you can access the functions by Declaring them
Thanks for your help. I already did this: In my project folder in references I linked my dll to the project. (I can see it in the project folder under references).
And I declared a new object in a global module I access in my project:

Public gMydll As Object

In my int method
gMydll = New MyDll.Class1

And I can use gMydll and it's methods, I only cannot see them if I write
gMydll.

I only see "gettype"
But I can use them, like gMydll.init, I only don't see the method, but I can use it. I think this might have something to do with the Options set in my VB.Net or my project?
if it is not ActiveX dll then you can access the functions by Declaring them
write gMydll = New MyDll.Class1 as
set gMydll = New MyDll.Class1
write gMydll = New MyDll.Class1 as
set gMydll = New MyDll.Class1


Sorry, that does make no sense for me, I think wirte is for storing data into a file. And you cannot use "=" for a TObject, and if I use "as" I get a file error. I made it like viewn above. But thanks for your help, now I know the problem.

If I declare
public gMydll=new gMydll.class1

then it works. But I do the following:
public gMydll as object

and in my init method:
gMydll = new gMydll.class1

And that is the course, why I don't see my methods. The only problem is that my dll has a constructor. And if I say

public gMydll=new gMydll.class1
this one calls the constructor. But I need to run my init function first, so I decided to make it this way:

public gMydll as object

and in my init method:
gMydll = new gMydll.class1

but then I don't see my methods of the dll anymore.
If you have an idea how to solve that, please let me know. For helping me finding the problem, you get the points anyway, thanks a lot!
Thanks a lot in helping me find this problem!