ActiveX DLL

xiaoxiao2021-03-06  61

December 5, 2004 21:43:09

1. The error in the Class_terminate event process is required. Using components cannot handle errors in class_terminate, these errors will be fatal for applications. 2. An error in the Initialize event is incorrectly occurring when the application creates the object, so it can be processed by the application. 3. Initialize and Terminate events will never be deal with users. In order to facilitate explanation of this example, a Thing object is created and destroyed. 4. When the ActiveX part accepted the first object requesting the object provided, it was to execute its Sub Main process, which before the component creates an object. The Sub Main process should be as short as possible because the execution time of the Sub Main may result in a request timeout for the creation of an object. 5. The End statement encountered in the "End" button or the END statement encountered causes the program to end, Visual Basic will recycle all memory and resources being used by the program. But this clearing is the same as a fatal error. Objects will not receive Terminate events. 6. In normal program operations, all of which releases all the references for an object will undermine the object. This is the meaning of the survival of the object. 7. To understand the order in which events occur in the part, debugging within the process is a powerful tool. 8. It is extremely important to avoid excess object references in the internal parts of the process. Customer applications can create and release hundreds of objects when using parts. If the object remains in memory because of its own reference, performance will inevitably reduce. 9. The internal part can be used as a library of providing processes and dialogs, using the internal parts of the process that can save programming time and provide consistent appearance and style for the application. 10. The client application does not call the dialog directly because the form is a private class. The client application cannot create an instance of a private class, and cannot pass the private class instance to the client application. 11. "Global" in the Global Objects only means that the object's method and attribute are added to the global namespace of the project, so it is not necessary to declare the object variable in advance. It is not that there is only one such object, or multiple client applications can share an object. For methods of using classes, but unlimited per client application creates an instance of a class. Just create a global object for each client application. 12. Visual Basic cannot distinguish between internal references for public variables and external (client applications) of public objects (client applications), so it won't uninstall DLL.

If you want to create a new ActiveX DLL, the following steps are generally used: 1. Determine the characteristics to be provided. 2. Determine which objects need to be required to logically divide the components. 3. All forms of design parts to be displayed. 4. Each class design interface provided for components, including properties, methods, and events. 5. Create an engineering group, including component engineering and test projects. 6. Implement the form you need for components. 7. Implement each class interface. 8. When adding new interface elements or features, add the same characteristics in the test engineering to verify the correctness of the new feature. 9. Compiling the DLL and test it with all possible situations.

转载请注明原文地址:https://www.9cbs.com/read-84342.html

New Post(0)