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
Printable View
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
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
There is a way if you think you're up to it.
Write the whole thing using nothing but API's.
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?
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.
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:
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:[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
Interesting thoughts though - i never realy thought about writing something in VB that didn't need to use any runtime files...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
You might as well just write it in C if you're only using API calls.
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 :)
Here is a simple Text Editor using API.
[Edited by Megatron on 08-10-2000 at 05:14 PM]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