Results 1 to 9 of 9

Thread: How to exclude the runtime files

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Vaxjo, Sweden
    Posts
    85
    Is there a way to compile a VB program so it won't need the VB6 runtime files. It's for a small app that is to be autorun from a CD?

    //Anders
    Reality is what you make up when you can't handle your fantasies.

  2. #2
    Addicted Member
    Join Date
    Jan 2000
    Location
    Sydney, Australia
    Posts
    196

    Thumbs down

    This question gets posted a fair bit. Basically <as far as i'm aware> theres no way to do this. Any VB app requires some runtime files, namely the main vb runtime dll, MSVBVM60.DLL <something similar to that - i can't remember> and then other runtime files for the controls and stuff in your app.

    One way you can get around this though is by using a program called "Fusion" - theres a review of this product at this very site:

    http://www.vb-world.net/misc/fusion/

    Basically what you want is the runtime files to be statically linked when you compile the program but VB does not do this. Fusion does but it costs money <i think you can trial it - the above article should explain better than me.

    hope this helps


  3. #3
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    There is a way if you think you're up to it.

    Write the whole thing using nothing but API's.
    Iain, thats with an i by the way!

  4. #4
    Addicted Member
    Join Date
    Jan 2000
    Location
    Sydney, Australia
    Posts
    196
    I would have thought that writing it entirely using apis would still need the MSVBVM60.DLL at least. How would you write something with the apis only? Is this even possible or are you just joking?

    What functionality does msvbvm60.dll provide?


  5. #5
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    I am not joking.

    Try a simple example and see. Create a new project. Remove the form. Use a "Sub_Main" and just create a message box with the API.

    Compile the app and try it on a machine without the VB runtimes.
    Iain, thats with an i by the way!

  6. #6
    Addicted Member
    Join Date
    Jan 2000
    Location
    Sydney, Australia
    Posts
    196

    Cool

    Cool - i tried doing as you said. There's still some references in the project that cannot be removed and the dependency file looks like:

    Code:
    [Version]
    Version=1.0.0.0
    
    [Project1.exe <0009>]
    Dest=$(AppPath)
    Date=11/08/00
    Time=00:53
    Version=1.0.0.0
    CABFilename=Project1.CAB
    CABINFFile=Project1.INF
    Uses1=msvbvm60.dll
    Uses2=OLEAUT32.DLL
    Uses3=OLEPRO32.DLL
    Uses4=ASYCFILT.DLL
    Uses5=STDOLE2.TLB
    Uses6=COMCAT.DLL
    BUT i havn't got a clean pc to test it on so i'm not saying that it would require those dlls, just that it thinks it does. All i had in my project was 1 module with:

    Code:
    Public Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
    
    Sub main()
        MessageBox 0, "hihihi", "bobo", 0
    End Sub
    Interesting thoughts though - i never realy thought about writing something in VB that didn't need to use any runtime files...

  7. #7
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    You might as well just write it in C if you're only using API calls.
    Harry.

    "From one thing, know ten thousand things."

  8. #8
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Good point Harry.

    Yeah those dll's are standard, but seeing as you never use
    them, they will not need to be in the package, so the
    package would be the EXE
    Iain, thats with an i by the way!

  9. #9
    Guest
    Here is a simple Text Editor using API.

    Code:
    Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
    Sub Main()
        hwnd = CreateWindowEx(&H8, "Edit", "Text Editor", &H160A0004, 0, 0, 500, 500, 0, 0, App.hInstance, ByVal 0&)
    End Sub
    [Edited by Megatron on 08-10-2000 at 05:14 PM]

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