Results 1 to 10 of 10

Thread: WinMain Function in VB

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    Has anybody tried using WinMain function in VB? I am having trouble in using it.

  2. #2
    Guest
    What kind of trouble?

    perhaps if you post or e-mail me your code and problems, I can help you.

    Gerco.

  3. #3
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    Why would you use WinMain in VB?
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  4. #4
    Guest
    Isn't it called 'WinMain' in VB?

  5. #5
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    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

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    We are not talking about Sub Main, but its about using the WinMain function that we use while programming through Win32 API .

  7. #7
    Member
    Join Date
    Jul 1999
    Posts
    42
    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.

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  9. #9
    Member
    Join Date
    Jul 1999
    Posts
    42
    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.

  10. #10
    Guest
    The closest you can get to WinMain, is the 'Main' sub in VB.

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