?
Solved

DLL methods (public)

Posted on 2003-03-24
9
Medium Priority
?
233 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 14 hours left to enroll

752 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