Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: StepAside on July 01, 2004, 12:08 AM

Title: DLL's
Post by: 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?
Title: Re:DLL's
Post by: Eli_1 on July 01, 2004, 12:06 PM
Post code.
Title: Re:DLL's
Post by: Eric on July 01, 2004, 01:22 PM
What language is the DLL being written in?
Title: Re:DLL's
Post by: CrAz3D on July 01, 2004, 11:26 PM
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.  
Title: Re:DLL's
Post by: StepAside on July 02, 2004, 12:38 AM
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.
Title: Re:DLL's
Post by: Adron on July 02, 2004, 03:03 AM
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.

Title: Re:DLL's
Post by: 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?
Title: Re:DLL's
Post by: Adron on July 03, 2004, 04:44 AM
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.
Title: Re:DLL's
Post by: Banana fanna fo fanna on July 03, 2004, 08:21 AM
I think it goes something like...

' you must have already regsvr32'd the dll
dim mydll
set mydll = CreateObject("myvbprojectname.myclsname")
Title: Re:DLL's
Post by: CrAz3D on July 05, 2004, 12:53 PM
*with mydll being an Object
Title: Re:DLL's
Post by: Banana fanna fo fanna on July 05, 2004, 02:42 PM
yeah i forgot the name