|
-
April 2nd, 2001, 12:19 PM
#1
VB build-in VS API
Is there any advantages to use API function, if VB has build-in function with the same features. For example MessageBox API and VB MsgBox.
Vlad
-
April 2nd, 2001, 12:24 PM
#2
Re: VB build-in VS API
The advantages are that you usually get more flexibility - for example the API call MessageBox allows you to specify the handle of the owner window. Thus, you can pass HWND_DESKTOP if your app has not loaded its main form yet and it won't cause problems.
The performance difference (in most cases) is negligible.
HTH,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
-
April 2nd, 2001, 12:27 PM
#3
Re: VB build-in VS API
In my opinion, what VB does is just wrap up Windows functions in a more usable form, so it is never more expensive to use an API function (you would call the Windows function, instead of VB doing it) and you get more flexibility (usability and power are generally inversely proportional) but at the cost of stability. Using VB functions only gives you a certain degree of stability that you lose when you resort to APIs(you have to remember all the chores of freeing up things, and in the correct order etc.)
-
April 2nd, 2001, 12:32 PM
#4
Re: VB build-in VS API
Thank you, guys. Actually my question was just about performance and something else - not flexibility. I know, that many things either cannot be done in VB (I use API), or can be, but with restrictions (I use API again).
Vlad
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
|