Results 1 to 2 of 2

Thread: how can i create Function Dll

  1. #1
    a_k
    Guest

    Angry

    hi all , how can i create Function in .dll file do anything like calculate between numbers (for Ex.)
    and use this Function in standard EXE Project by Declare Function like Declare API Functions

    i use (ActiveX DLL) and create Function calculate between 2 numbers .
    this code in the (ActiveX DLL) Class

    Public Function FirstFunction(X1 As Long, X2 As Long) As Long
    FirstFunction = X1 + X2
    End Function

    and make a dll file
    ------------------------------------------------------------------------
    and in new (standard EXE) Project
    add new Module1
    add this code in Module1

    Public Declare Function FirstFunction Lib "C:\WIN98\Desktop\DLL\DllFileName.dll" (X1 As Long, x2 As Long) As Long

    add this code in the form code

    Private Sub Form_Load()
    Text1.Text = FirstFunction(3, 5)
    End Sub

    run the program
    you will see (error(453) Can't find Dll entry point FirstFunction in DllFileName.dll)
    how i can solute this Problem ?
    -------------------------------------------------

  2. #2
    Addicted Member Babbalouie's Avatar
    Join Date
    Jan 2001
    Location
    On the bright, blue sea...
    Posts
    197
    If you created the DLL, you dont need to declare it in your program. Go to the Project | References menu option, and find the DLL you created in the list provided. Then create an instance of it in your program.
    Building A Better Body Albeit Left Out Under Intense Extrapolation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width