-
Hello!
Somewhere I heard that if I create program in VB just with API, I don't need runtimes.
I tried that (created messagebox through API) and it didn't work (I renamed MSVBVM60.DLL) - it requested that DLL.
Is there any other way (besides C) for creating program without runtimes, 'cause I need it as CD Launcher? If it isn't can you suggest me some light tutorials for beginners in VC?
Zvonko
-
it works if you only have a module in your project
-
Yes, I have just one module, but It still demands VB's DLL.
Here's the code:
Code:
Private Declare Function MessageBoxIndirect Lib "user32" Alias "MessageBoxIndirectA" (lpMsgBoxParams As MSGBOXPARAMS) As Long
Private Declare Sub PostQuitMessage Lib "user32" (ByVal nExitCode As Long)
Const CDL_TITLE = "CD Setup Loader"
Const SHGFI_ICONLOCATION = &H1000
Const MB_ICONASTERISK = &H40&
Const MB_ICONEXCLAMATION = &H30&
Const MAX_PATH = 260
Private Type MSGBOXPARAMS
cbSize As Long
hwndOwner As Long
hInstance As Long
lpszText As String
lpszCaption As String
dwStyle As Long
lpszIcon As String
dwContextHelpId As Long
lpfnMsgBoxCallback As Long
dwLanguageId As Long
End Type
Sub Main()
Dim MBP As MSGBOXPARAMS
MBP.cbSize = Len(MBP)
MBP.dwStyle = MB_ICONASTERISK
MBP.hInstance = App.hInstance
MBP.lpszText = "KR nekej za probo, èe dela..."
MBP.lpszCaption = CDL_TITLE
MessageBoxIndirect MBP
PostQuitMessage 0
End Sub
Can you help me?
-
have you removed Form1 from your project ?
-
Yes, I've removed Form1 from project.
But maybe there are References that are causing problems.
I'll try to remove all of them and let you know what happened.
-
Hi,
I was wondering about that myself. Tried your code, it doesn't work for me either.
Anyone know why?
-
You cannot use a VB program without the runtimes. You can package them up using tools like Fusion, but it has to be there. Not griping here, but try reading other threads before you post - this question has been answered about 10 times already :(.
For C, try http://www.programmingtutorials.com
-
If you are just looking for something that will run when your installation or program CD is installed, you should just make an autorun.inf file. A simple one would look like this:
[autorun]
open=Filename.exe
icon=Filename.exe,1
You can find out more from Microsoft at http://msdn.microsoft.com/library/ps...tm#autorun.inf
Hope this helps.
-
Instead of trying to learn VC (unless you want to continue to do more and more programming in VC, then it might be worth it). I would suggest going the Delphi route. Its much easier then VC and very similar to VB in a lot of ways. But it is much more powerfull because it is not an interpreted language. Delphi is actually OO Pascal. The Delphi visual development environment is written in OO Pascal therefore no dependencies on anything microsoft unless you need it. (you might say Delphi was written in Delphi) Personally I do all my personal programming in Delphi. I only use VB here at work cause I HAVE too.
PS.. if youre already familiar about Delphi sorry for wasting your time. :)
-
Static linking can be done in VB. THere is a program which I think is called Crunch that will do it. Alternastively, it is possible to intercept the Link.exe section of the compilation and force static linking when compiling. But, to be honset, i've yet to try it out, so I don't know how well it works. Theoretically, it is possible though
- gaffa
-
And does anyone know where can I get this program (Crunch)?