Dynamic Link Library

Source: Internet
Author: User

1. How to understand an applicationProgramWhich DLL files are used?

Right-click the application and choose "Quick View" from the shortcut menu, in the "Import table" column of the "Quick View" window that appears, you will see the usage of DLL files.

2. How to know that the DLL file is used by several programs

Run regedit and enter hkey_local_machinesoftwaremicrosrftwindowscurrent-
View the versionshareddlls subkey. All DLL files and their related data are displayed in the right window. The numbers in the parentheses on the right of the data indicate that they are used by several programs. (2) it indicates that it is used by two programs, and (0) indicates that no program is used. You can delete it.

3. How to Solve DLL file loss

When detaching a file, you are reminded that deleting a DLL file may affect the running of other applications. When you uninstall the software, you may accidentally delete the shared DLL file. Once the DLL file is lost, you can find the DLL file in sysbckup (System Backup folder) and copy it to the system folder. If this is not the case, "*** DLL file loss..." always occurs when the computer is started ......" You can run msconfig in "Start/run". After Entering the System Configuration Utility dialog box, click "system. ini "label to find the DLL file that is prompted to be lost, so that it is not selected, so that no error prompt will appear at boot.

--------------------------------------------------------------------------
Use the VB ActiveX. dll file in ASP

No one will take a more troublesome approach to work without any need, unless there is no choice. So if I want to tell you that there is a simple technology that can make your ASP development faster and more efficient, you must be particularly interested in this. This method transfers the vast majority of business logic on your ASP page to a Visual Basic ActiveX. DLL to improve the performance of the entire web page.

Why ActiveX. dll is used

Creating a. dll file in Visual Basic is actually an ActiveX object. This type of object can be implemented using Microsoft's Component Object Model (COM) technology. You can also use them to create classes related to. dll.

There are many reasons for developers to use. dll, and each project does not contain all the advantages. However, once you adopt this method, you will find that you are using ActiveX. DLL technology. Now let's take a look at the advantages of ActiveX. DLL technology.

Better performance
Without any doubt, a major concern of a developer is the complete performance. Compared with a common ASP page, an ActiveX. dll runs faster. Let's take a look at a simple example. An ASP page calculates a variable from 0 to 10000000, and then it takes 26,087 milliseconds to display a "done" string. However, the VB. dll file only takes 100 milliseconds to complete this process. Therefore, VB. dll is 260 times faster than ASP pages.

In such a test, the speed difference is obvious, because ASP runs for 26 seconds,. dll only needs to run for less than 1 second. Remember, the speed difference is mainly related to the workload of the Code to be processed. That is to say, the larger the workload of code execution, the more obvious the speed difference. If you double the size of the above test files, the speed difference will become more obvious. ASP pages take 25,156 milliseconds, But. dll only takes 70 milliseconds-the latter runs at 359 times.

There are two reasons for. dll running faster than ASP pages:

. Dll is compiled. This means that the file runs in the machine language, which achieves the speed it can achieve. The ASP page runs the code processed by a script engine, so that each part must be compiled before being processed.
. Dll uses a variable declared as a long integer, which does not need to be interpreted by a 32-bit processor. The script on this page uses a variant variable. This variable type must be converted into a number before it can be used in computing. This will inevitably increase the processing time.

Better variable declaration method

The variable declaration method can make the operation more rapid, in addition, it can also be easier to program development, because the variable type does not need to be converted. Variables can be declared in the Initial State to avoid writing additional conversion code lines.

Source code hidden
A. dll file can hide your source code to prevent some hacker attacks. An ASP page stores scripts in plain text to your network server. Once someone gains access to your website file, the webpage is easily accessed, so your source code is exposed and damaged. Use a Common ActiveX. dll file to process the business logic of your site, which can prevent malicious people from accessing your source code.

Richer Development Environment
You can also use the Microsoft Script Editor to Develop ASP scripts. Although this is a relatively complete tool, it only provides basic script features. On the contrary, Visual Basic is a rich development environment. In short, these two tools are not comparable-one is a script tool, and the other is a fully functional development software package.

More efficient cross-development
The. dll created with VB is easily applicable to other development environments, such as Microsoft Access. On the other hand, when performing cross-development with other environments, developers must recreate an ASP page task.

More efficient ASP pages
A business logic that contains all can become very lengthy .. DLL files are a very efficient solution because they contain all the logic. The management result is simpler and more efficient code.

Some Disadvantages
In most cases, the advantages of ActiveX. dll are better than those of ActiveX. dll, but you should remember that there are still some shortcomings. First, ActiveX. dll may lead to more development time in some cases. For example, it takes about two seconds to use the. dll file in variable calculation, but only one second for ASP pages. However, this is not obvious at the beginning. A well-organized and reusable ActiveX. dll class used in the final stage can shorten your development time.

Second, typical ASP pages are easily changed: you only need to add scripts and save files. Updating a. DLL associated with an ASP page is quite complicated, because you cannot compile. DLL without restarting the network server. However, as a general rule, you can simply restart the network server and then compile or copy a new. dll when the server runs again. Restarting the server takes only one second, so there will be no interruptions.

Third, the running time must be set up on the network server. If you use ActiveX. DL on an ASP page without installing the VB runtime, you can simply install all the processes using the software package and Development wizard. Remember, if you or your users want to use ADO, you must install other software, such as MDAC.

Tips for using ActiveX. dll

Using ActiveX. dll is not very difficult, but some simple skills will make your development process smooth. First, do not forget to register a. dll and use it. To register an ActiveX. dll, you can use Windows API to call a function:

Public declare function. dllselfregister lib "vb6stkit. dll" (by Val LP. dllname as string) as integer

After changing a. dll, if you need to add a new class or copy the source code to another development environment, you must register the. dll again. Compile an ActiveX. dll and assign a unique identifier to the file. If you copy the source code to another machine and compile it, the identifier will change and map to the current machine. In this way, every time you copy. DLL to the network server, you must register it again.

When using. DLL files, you sometimes need to manually start the server. The simplest way to manually restart the Network Information Server (IIS) is to connect through computer management (a Windows2000 function. If you have a Windows 2000 Server resource toolbox, you can also use the service. vbs tool to run these batch files:

C:
CD \
Cscriptservice. vbs/X/n w3svc/s iismachinename
Pause
Cscriptservice. vbs/G/n w3svc/s iismachinename

When debugging. dll, use the debugging features of Visual Basic, including allowing you to view all the code when you load an ASP page. You can learn more about Visual Basic Debugging in the Microsoft Knowledge Base bar.

Use. DLL to get more benefits
A common ASP page cannot be compared with a webpage related to Visual Basic ActiveX. dll. The latter runs faster and has a higher development efficiency. This makes the development process smooth for its users. You can develop a better product for users, and everyone can get more benefits from such management.

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.