PDA

Click to See Complete Forum and Search --> : DLL-problems!!!


vbAlex
Nov 16th, 1999, 12:56 AM
hi

i created a dll with one function. i compiled this dll and created a normal exe project and wanted to test the dll.
i declared the dll and wrote some code.
but when i want to call the function in the dll, vb says, i wasn't able to find the point in the dll.
this is the first time, i work with dlls.
please help me!!!

Serge
Nov 16th, 1999, 01:10 AM
It depends. If you created this DLL in VB then this DLL is an ActiveX DLL. So you have to add a reference to this DLL by going to Project-->References....

If you created this DLL in C/C++ or Delphi as static DLL then you have to declare this dll like:

Private [Public] Declare Function YourFunctionName Lib "YourDLLName" (ByVal YourParameter As YourDataType) As Long



Regards,

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)

vbAlex
Nov 16th, 1999, 01:23 AM
thanx, do i have to create the reference on the other (default exe) project???

Serge
Nov 16th, 1999, 01:42 AM
No, basically, when you're creating a new project and want to use your DLL, then you would set a reference to that DLL (put a check mark on the DLL you've created in the reference List). Then you would declare a variable as your DLL's class.

Dim oMyVariable As New YourDLL.YourClass


Then you would use the function that you've created:

Call oMyVariable.MyFunction(YourParameter)

THen, you compile your EXE. And when you give this EXE to the user, you would have to give him/her this DLL as well. But the best way is to create a Setup for your program. VB5 has Setup Wizard (VB6 Package and Deployment Wizard) which will include all needed files for your aplication.


Regards,

------------------

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)



[This message has been edited by Serge (edited 11-16-1999).]

vbAlex
Nov 16th, 1999, 01:59 AM
thanx!