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?
Post code.
What language is the DLL being written in?
Quote from: StepAside on July 01, 2004, 12:08 AM
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?
I use CreateObject(). It works fine for me.
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.
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.
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 from: StepAside on July 02, 2004, 01:31 PM
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?
Yes, something like that. Create an instance of a class defined in the DLL and use the properties / methods of it.
I think it goes something like...
' you must have already regsvr32'd the dll
dim mydll
set mydll = CreateObject("myvbprojectname.myclsname")
*with mydll being an Object
yeah i forgot the name