VB is how to do the omnipotent

Source: Internet
Author: User
A lot of books about VB6 that VB developed to 6.0 this version is omnipotent, the purpose of this article is not to evaluate the appropriateness of this statement, but to reveal how VB is to do "omnipotent."

Anyway, VB can be applied to hardware control, memory management, Process control, large enterprise system programming is an indisputable fact, although in some applications VB is not the most ideal development tool. So how does VB achieve these?

First of all, VB has a convenient ActiveX extension interface. This makes VB has the possibility of infinite extension in the use of control and non visual components.

Open the VB6 integrated development environment, new Standard EXE project, you will find that the toolbox is not a lot of controls, is not enough to develop a complete program. When you open the [engineering]--[parts] menu, you'll find that the controls you might use are basically inside, including the ADODC for connecting to the database, the DataGrid for binding and displaying data, or the common DIALOG for displaying various common dialog boxes, and you can even click [browse button to add a third party or your own use of other language tools to write OCX control, which is VB convenient OCX expansion interface. With this interface, you will no longer have to worry about VB's limited built-in controls.

Next you will find that there are many applications, especially the operation of files or the application of higher requirements for customization is difficult to achieve with simple controls. When you open the [engineering]--[Reference] menu, you'll find a lot of objects you might use. Microsoft has already written it for you, including FileSystemObject for file operations or ADODB for database operations, and of course many third-party dynamic link libraries will appear inside, After you have added the appropriate reference, you can see the object and method in the Object Browser, of course, you can also click the [Browse] button to add a third party or your own use of other language tools to write DLL dynamic link library, which is VB convenient DLL extension interface.

Second, VB from version 6.0 can establish ActiveX control engineering and ActiveX DLL project. This means that you can encapsulate some of the commonly used controls or classes into COM objects, in order to achieve binary code reuse, which is very meaningful to build a large enterprise system, you can even in VC + +, Delphi and other development tools inside the call you write with VB object. Of course, using VB to write ActiveX control is not a good idea, VC + + is sometimes a better choice.

Finally, by declaring and invoking Windows API functions (Windows application interface functions), VB can extend tentacles into the operating system to achieve some of the underlying functions. VB declares API functions through the following format:


Private Declare Function sendmessage Lib "user32" Alias "SendMessageA" (ByVal hwnd as Long, ByVal wmsg as Long, ByVal WPar Am as long, lParam as any) as long

API functions can be invoked as intrinsic functions once they are declared, although calls should pay attention to function return values and parameter types.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.