Valhalla Legends Forums Archive | Visual Basic Programming | DLL's

AuthorMessageTime
StepAside
I'm trying to get into programming DLLs for a lot of my projects to make my life easier. I've never written one before however, so it's confusing me. I create the function within the class of the DLL, and create the .dll. I attempt to call the function with API from another project, and tells me:
"Can't find DLL entry point in blah.dll"

Any suggestions?
July 1, 2004, 5:08 AM
Eli_1
Post code.
July 1, 2004, 5:06 PM
LoRd
What language is the DLL being written in?
July 1, 2004, 6:22 PM
CrAz3D
[quote author=StepAside link=board=31;threadid=7520;start=0#msg68045 date=1088658494]
I'm trying to get into programming DLLs for a lot of my projects to make my life easier. I've never written one before however, so it's confusing me. I create the function within the class of the DLL, and create the .dll. I attempt to call the function with API from another project, and tells me:
"Can't find DLL entry point in blah.dll"

Any suggestions?
[/quote]

I use CreateObject(). It works fine for me.
July 2, 2004, 4:26 AM
StepAside
Although all but 3 posts were completely off my question, it's ok. I feel the need to bash idiots at times. Anyway, I wrote the DLL in Visual Basic with only a class, an API delcaration, and 2 Public functions written in the the DLL. I then tried to call the functions using API, with the given library as "whatever.dll", (as I named my DLL). I get an error that it cannot find the DLL entry point. Also, I've googled the hell out of it. It only gives me info about the error from the cross-language aspect. IE: VB DLL called from ASP, C++ DLL called from VB, etc. Once again, any help appreciated.
July 2, 2004, 5:38 AM
Adron
VB doesn't export functions from a DLL in the way a DLL normally works in every other language.

A VB DLL exports a standard OLE function to allow you to create any public objects defined in the VB DLL project. To use a VB DLL, you have to create such objects and call methods on them. You can't just "Declare Function" and call them.

July 2, 2004, 8:03 AM
StepAside
So basically I'd have to first reference the DLL, then create a class and set it's object to work with the different functions in the DLL?
July 2, 2004, 6:31 PM
Adron
[quote author=StepAside link=board=31;threadid=7520;start=0#msg68225 date=1088793100]
So basically I'd have to first reference the DLL, then create a class and set it's object to work with the different functions in the DLL?
[/quote]

Yes, something like that. Create an instance of a class defined in the DLL and use the properties / methods of it.
July 3, 2004, 9:44 AM
St0rm.iD
I think it goes something like...
[code]
' you must have already regsvr32'd the dll
dim mydll
set mydll = CreateObject("myvbprojectname.myclsname")
[/code]
July 3, 2004, 1:21 PM
CrAz3D
*with mydll being an Object
July 5, 2004, 5:53 PM
St0rm.iD
yeah i forgot the name
July 5, 2004, 7:42 PM

Search