Results 1 to 5 of 5

Thread: DLL-problems!!!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    chicago (hope)
    Posts
    146

    Post

    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!!!


  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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
    [email protected]
    [email protected]
    ICQ#: 51055819


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    chicago (hope)
    Posts
    146

    Post

    thanx, do i have to create the reference on the other (default exe) project???

  4. #4
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    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
    [email protected]
    [email protected]
    ICQ#: 51055819



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

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Oct 1999
    Location
    chicago (hope)
    Posts
    146

    Post

    thanx!

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