Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

DLL methods (public)

Posted on 2003-03-24
9
Medium Priority
?
244 Views
Last Modified: 2010-05-01
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
0
Comment
Question by:Firlefanz
  • 4
  • 4
9 Comments
 
LVL 3

Expert Comment

by:Jonyv
ID: 8201043
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
0
 

Author Comment

by:Firlefanz
ID: 8201890
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???
0
 
LVL 5

Accepted Solution

by:
avya2k earned 400 total points
ID: 8202052
Provided ur Dll is VbActiveX dll

lets say ur dll is "MyDll.dll"
and the public class inside Dll is "Class1"
let say u have public function MyFunction
Go in project menu and click references
browse for ur dll and set reference to it
then declare ur dll as
dim newDll as new MyDll.Class1
'now call ur function as
newDll.MyFunction

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 5

Expert Comment

by:avya2k
ID: 8202056
if it is not ActiveX dll then you can access the functions by Declaring them
0
 

Author Comment

by:Firlefanz
ID: 8202175
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?
0
 
LVL 5

Expert Comment

by:avya2k
ID: 8202250
if it is not ActiveX dll then you can access the functions by Declaring them
0
 
LVL 5

Expert Comment

by:avya2k
ID: 8202262
write gMydll = New MyDll.Class1 as
set gMydll = New MyDll.Class1
0
 

Author Comment

by:Firlefanz
ID: 8202503
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!
0
 

Author Comment

by:Firlefanz
ID: 8202514
Thanks a lot in helping me find this problem!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

577 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question