Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling VB DLLs from another VB program

Status
Not open for further replies.

robdon

Programmer
May 21, 2001
252
0
0
ES
Hi,

I'm having a bit of a problem with DLLs.

I have a DLL, that I have created in VB as follows....

1) Create ActiveX DLL
2) Made the Instancing 'GlobalMultiUse'
3) Created a sub

Public Sub rob()
Msgbox("Hello")
End Sub

4) Compiled the DLL and moved it to the same dir as where I will create the next project. (exe)

5) Registered it using regsvr32, but I dont think this is needed because I'm in Windows 2000.

Then I created another VB application (standard exe) to try to test my DLL, before I use it in another language.

I created a module and put the following in it...

Public Declare Sub rob Lib "project1.dll" ()

and then I put the following in the Click event of a button

rob

When I click the button I get the error message....

Can't find DLL entry point rob in project1.dll

I dont want to include it as a reference as this is not the way I wanted to test it. But... It does seem to work if its included as a reference.

Anyone any ideas on what I have done wrong?

Thanks,

Rob Donovan.
 
Have you tried going to Project, References..., Browsing for your .DLL, adding it to the list of References, checking the box beside it, then calling rob() ?
 
I could be wrong about this but I think your dll needs to be in the "C:\WINNT\SYSTEM32" directory. Try moving it there, registering it again, then try you other project again. Hope this helps.
 
You have to reference it. There is no other way.

Why exactly don't you want to reference it? I work with DLL's and MTX quite a bit and may be able to help with what your trying to do. Craig, mailto:sander@cogeco.ca

Remember not to name the Lambs...
It only makes the chops harder to swallow
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top