Activex DLL Focus

Source: Internet
Author: User

December 5, 2004 21:43:09

1. The error in the Class_Terminate event procedure must be handled. Applications that use parts cannot handle errors in Class_Terminate, so these errors will be fatal to the application.
2. The error that is not handled in the Initialize event occurs when the application creates the object, so it can be processed by the application.
3. Initialize and Terminate events should never deal with users. To illustrate this example, use them to give a visual explanation of how a Thing object was created and destroyed.
4. When When an ActiveX part receives the first request for its provided object, it executes its Sub Main procedure, which precedes the part creation object. The Sub Main procedure should be as brief as possible, because Sub Main's execution time may cause the request to create the object to time out.
5. “End"button or the end statement encountered in the code causes the program to end abruptly, Visual Basic reclaims all the memory and resources that the program is using. But this cleanup is like a program that has a fatal error. Object will not receive the Terminate event.
6. In normal program operations, all references to an object are released after all to destroy the object. This is the meaning of the object's survival period.
7. In-process debugging is a powerful tool to understand the order in which events occur in a part.
8. It is extremely important to avoid extraneous object references in in-process parts. The customer application can create and release hundreds of objects when working with parts. If objects are kept in memory because of their own references, performance will inevitably degrade.
9. In-process parts can be used as libraries to provide processes and dialogs, while using in-process parts can save programming time and provide consistent look and feel for applications.
10. The client application does not invoke the dialog box directly because the form is a private class. Client applications cannot create instances of private classes, nor can they pass instances of private classes to client applications.
11. Global in global objects simply means that the methods and properties of the object are added to the project's global namespace, so you do not need to declare the object variables in advance when you use them. This is not to say that there is only one such object, or that multiple client applications can share an object. For each client application that uses a method of the class but is not qualified, an instance of the class is created. Only one global object is created for each client application.
12. Visual Basic cannot distinguish between internal references to public variables and external (client application) references to public objects, so it does not unload DLLs.

If you are creating a new ActiveX DLL, the following steps are generally used:
1. Determine the features to be provided by the part.
2. Determine what objects are needed to logically divide the functionality of the part.
3. Design the part to be displayed for all forms.
4. Design interfaces for each class that the part provides, including properties, methods, and events.
5. Create a project group, including part engineering and test engineering.
6. The form that is required to implement the part.
7. Implements the interface for each class.
8. While adding new interface elements or features, add the same features to the test project to verify the correctness of the new functionality.
9. Compile the DLL and test it with all the possible scenarios.

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.