Click to See Complete Forum and Search --> : WinMain Function in VB
amitabh
Jan 15th, 2001, 10:23 PM
Has anybody tried using WinMain function in VB? I am having trouble in using it.
What kind of trouble?
perhaps if you post or e-mail me your code and problems, I can help you.
Gerco.
Vlatko
Jan 16th, 2001, 05:16 AM
Why would you use WinMain in VB?
Isn't it called 'WinMain' in VB?
KrishnaSantosh
Feb 7th, 2001, 09:47 AM
I Think This would help
In A Module Enter The Code
sub main()
'' Startup Code
end sub
__
Go to the project Properties and Select The Startup To Sub Main. and That's It.
Ex:
Sub Main()
form1.show
end sub
amitabh
Feb 11th, 2001, 12:42 AM
We are not talking about Sub Main, but its about using the WinMain function that we use while programming through Win32 API .
Alfred
Feb 11th, 2001, 07:47 AM
The WinMain() function is not an API function. It is a entry point required by the VC++ compiler to create a WIN32 application in Visual C++. It has nothing to do with VB. You can not call the WinMain() function because it doesn't exist in in the WIN32 API.
parksie
Feb 11th, 2001, 08:06 AM
It's not just VC++ -- every program for windows must export the WinMain function. VB inserts its own into your program to initialise COM, the forms, etc.
Alfred
Feb 11th, 2001, 08:49 AM
You are right, one way or another there must be a WinMain() function even if you compile your VB code to P-code instead of native code. But there is no way you can get VB code into a WinMain() because this code must be in C/C++, and this is a VB form.
The closest you can get to WinMain, is the 'Main' sub in VB.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.