Results 1 to 10 of 10

Thread: INclude dll files in exe

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Posts
    1

    Question

    Is there any way to compile dll files into an executable.

  2. #2
    Guest
    you can use Bit-Arts Fusion
    I hear it costs a-lot though.

  3. #3
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892

    Exclamation Another way!

    If it's not an ActiveX DLL, then you can include it in a resource file. Make your program check if it exists as a regular file. If it doesn't, your program will give the resource file a ring and tell it to create the file.

    If it's an ActiveX DLL then this way obviously doesn't work (ActiveX DLLs must exist when the program loads, so the program can't get them to exist).
    However if it's an ActiveX DLL, then you can create two applications.
    One is your program, and the other will contain the DLL in it and will unpack it.
    The unpacking program does not require the DLL so it will work.
    The user will have to use the unpacking program, or the actual program won't work.

    Checking what type of DLL it is:
    ActiveX DLL: A DLL which is referenced in Project menu -> References.
    Non-ActiveX DLL: A DLL which is referenced in a Declare statement in the code.

    Post if you need instructions for how to do this.

  4. #4
    Guest
    what if he needs to include Msvbvm60.dll or another ver. vb dll?
    how is the res file gonna work then?

  5. #5
    Guest
    Here is an example made in VB on how to make an Active Self-Extractor.

    Active Self-Extract

    The author says that it works. And if you look at his feedback, for some people, it worked great.

  6. #6
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Ummm... In that case... Create an unpacking program in Visual C++!

    Or use Bit-Arts Fusion which of course costs a lot.

  7. #7
    Guest
    You could also try joining files together using this code:

    Code:
    Public Function JoinFiles(Source1 As String, Source2 As String, _
       Dest As String) As Boolean
       
       On Error GoTo errorhandler
       Dim Buffer() As Byte
        
       
    
       Open Source1 For Binary Access Read As #1
       Open Source2 For Binary Access Read As #2
       Open Dest For Binary Access Write As #3
       
       ReDim Buffer(1 To LOF(1))
       Get #1, , Buffer
       Put #3, , Buffer
       
       ReDim Buffer(1 To LOF(2))
       Get #2, , Buffer
       Put #3, , Buffer
       
       Close #1, #2, #3
       JoinFiles = True
    errorhandler:
        Close #1
        Close #2
        Close #3
    Exit Function
    I never used this, if you do use it, let me know if it works.

    [Edited by Matthew Gates on 08-18-2000 at 01:24 AM]

  8. #8
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    It would work, but:
    • The things you put just after Exit Function should be just before it.
    • It is not useful for including DLL files in your EXE...

  9. #9
    Junior Member
    Join Date
    Mar 2000
    Posts
    28
    True, but if you extracted and registered the needed files before anything in your project references it, then you'll be just fine.

    Create a Sub_Main and add the routines to check if the needed files exist. If they do not, then extract them from the resource file and run RegSvr on them. Then load your main form.

  10. #10
    Junior Member
    Join Date
    Mar 2000
    Posts
    28
    And if you plan on investing in BitArts Fusion because you think it protects your OCXs and DLLs, then you're mistaken. All it does is extract and register the included files if they do not already exist, which offers no protection whatsoever.

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