|
-
Aug 10th, 2000, 08:01 AM
#1
Thread Starter
Lively Member
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.
-
Aug 10th, 2000, 08:13 AM
#2
Addicted Member
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
-
Aug 10th, 2000, 08:23 AM
#3
Fanatic Member
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!
-
Aug 10th, 2000, 09:30 AM
#4
Addicted Member
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?
-
Aug 10th, 2000, 09:42 AM
#5
Fanatic Member
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!
-
Aug 10th, 2000, 10:04 AM
#6
Addicted Member
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...
-
Aug 10th, 2000, 10:20 AM
#7
Frenzied Member
You might as well just write it in C if you're only using API calls.
Harry.
"From one thing, know ten thousand things."
-
Aug 10th, 2000, 10:26 AM
#8
Fanatic Member
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!
-
Aug 10th, 2000, 04:12 PM
#9
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|