Results 1 to 31 of 31

Thread: Create VB form using API?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Create VB form using API?

    I once thought VB was very limited until I discovered the API.
    I'm hoping that most or all of the API functions that can be used
    in C++ can also be used in VB. Specifically, I'm wondering if you
    can make calls to create a window or a dialog box?

    thanks

  2. #2
    Megatron
    Guest
    See this link.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276
    thanks.
    i also found it on allapi.net

    two more questions: since this is all API, will it still be bound to the
    VB runtime dll or will it be independent as the same app written
    in C++?

    how do you load a new icon for the .exe (also for C++)?

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Yes, you will need the runtimes because even though you're calling API functions, the language support is still required, which is what part of the runtimes provide.

    If you want independence use Fusion or C++
    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

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276
    yeah i was afraid of that.
    what is fusion?
    what about the icons?

  6. #6
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Fusion packages all the DLLs up *inside* an EXE file so you have a single (large!) program to run, that requires no installation. I think it's www.bitarts.com or www.bit-arts.com (something like that ).

    As for icons, I think when you go to Make EXE->Options you can set the icon there. In C++ it's the lowest numbered compatible icon in the resource file (I think -- only ever had one icon )
    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

  7. #7
    Megatron
    Guest
    Originally posted by parksie
    If you want independence use Fusion or C++
    Fusion doesn't give independance, rather it packs all files into a bundle.

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Isn't that basically the same thing?
    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

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276
    megatron,
    originally posted by parksie...
    Fusion packages all the DLLs up *inside* an EXE file so you have a single (large!) program to run
    giving you independence from installing the vb .dll
    before running the .exe

    also, C++ takes my highest ordered icon in my .rs file. ?

    parksie, the only problem is, in VB, if you don't have a form added
    to your project, then you can't select an application icon. you get
    the default VB icon.

    I tried to add a resource file with an icon, but it tells me that I have
    to have the 'resource add-in' installed, which I don't. Even then,
    I don't know if I added the icon to the .res file if VB would be smart
    enough to know that I want it to be my .exe icon.

  10. #10
    Addicted Member
    Join Date
    Apr 2001
    Posts
    250
    Sadly, VB does not allow you to use resource icons.
    There is however, a thread that has a link to a program that hacks your .exe file after compile and inserts the desired icon as the exe's icon. The thread was called something like "hacking put to a good use"
    Why does everyone think I may be dangerous? I'm just good at computers.

  11. #11
    Megatron
    Guest
    Originally posted by parksie
    Isn't that basically the same thing?
    No. Independance means strictly on it's on own, with no runtimes. (Fusion does not eliminate the need for these runtimes)

  12. #12
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Okay I think I see your point now

    I saw independence as "has everything it needs with it", rather than "doesn't need anything else". Under that same description, C++ programs aren't independent because they have the runtime library linked directly into them.
    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

  13. #13
    Megatron
    Guest
    Let's not go too deep here. Independance in a sense that there's no doubt that C programs will always run on a windows platform, but VB programs will only work if the user has the runtimes, hence, you have to take that percentage into consideration.

  14. #14
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    But if you package them all up in Fusion...
    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

  15. #15
    Registered User Olly's Avatar
    Join Date
    Apr 2001
    Location
    Switzerland
    Posts
    252
    I wonder how fusion works. I mean it would have to extract the dll's and register them or not? I mean how would it work then?

  16. #16
    Megatron
    Guest
    Originally posted by parksie
    But if you package them all up in Fusion...
    Package them, include them, hardcode them etc. are all methods of including them. Independance would be to not include them at all.

  17. #17
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    But including them directly is what C++ does as well

    This discussion isn't going anywhere is it? We've just started nitpicking over semantics so that's not really the point
    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

  18. #18
    Addicted Member
    Join Date
    Apr 2001
    Posts
    250
    I congratulate both of you for giving me a headache and a free class. Pass me the aspirin.
    Why does everyone think I may be dangerous? I'm just good at computers.

  19. #19
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    *passes aspirin*

    Oh ho ho...I haven't even started giving you a headache yet But in the interests of being nice...I'll shut up now
    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

  20. #20
    Addicted Member
    Join Date
    Apr 2001
    Posts
    250
    (takes aspirin)

    By the by, what would be independent? Assembly language? Or does that still depend on runtimes?
    Why does everyone think I may be dangerous? I'm just good at computers.

  21. #21
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Assembly does not require runtimes, but is OS-dependent because you HAVE to use the API for most things (or DOS interrupts )
    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

  22. #22
    Megatron
    Guest
    It all depends on which perspective you are looking at this. Some see independance as a C++ app, with no runtimes or components attached, while others see everything as dependant, because they all require some sort of dependants (and I'm not talking about the diapers here! )

  23. #23

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276
    With all the fuss, I don't see why Microsoft doesn't just make VB
    independent of the damned dll's.

  24. #24
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    With the way it works it's very difficult to implement like that.

    Visual Basic is COM-based, and as such requires a registered COM server for most of its intrinsic functionality (text boxes, command buttons, etc.). Including this within the EXE would require a considerable rewrite of their distribution strategy.

    Anyway, with VB.NET this disappears because by definition you have the runtimes there
    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

  25. #25
    Addicted Member
    Join Date
    Apr 2001
    Posts
    250
    It all depends right down to the basic computer components. Even chip commands vary.
    Why does everyone think I may be dangerous? I'm just good at computers.

  26. #26
    Megatron
    Guest
    Originally posted by wey97
    With all the fuss, I don't see why Microsoft doesn't just make VB
    independent of the damned dll's.
    I don't think it's that easy. As a work around, I think they should include the VB runtimes from VB4 + and all of the commonly used components in their next version of Windows.

  27. #27

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Location
    Birmingham, AL
    Posts
    1,276

    Thumbs up

    'nuff said.

  28. #28
    Addicted Member
    Join Date
    Apr 2001
    Posts
    250
    Megatron's suggestion would probably save programmers alot of trouble.
    Why does everyone think I may be dangerous? I'm just good at computers.

  29. #29
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    It would also save MS a lot of trouble than the rewrite I suggested
    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

  30. #30
    Registered User Olly's Avatar
    Join Date
    Apr 2001
    Location
    Switzerland
    Posts
    252

    Exclamation

    By the way: using fusion in your app increases its ram usage to an additional 2mb. Considering that a normal vb app already uses up about 5 to 8 this cold get to a real bottleneck.

  31. #31
    Addicted Member
    Join Date
    Apr 2001
    Posts
    250
    Ooouch! Not something I like.... Noting all my cute vb bots take up a lot of resources and the pc's utilities take up 1/4 of all resources.
    Why does everyone think I may be dangerous? I'm just good at computers.

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