Using ASP built-in objects in COM components

Source: Internet
Author: User
Tags stub

In some projects, it is often necessary to implement a c/s&b/s hybrid architecture, which involves web development, Before Ms. NET appeared, because it was running on top of the Windows environment, the preferred ASP was realized, until one day, gates carried the. NET banner, Chenge: with batting practice. NET, safe and fast without side effects, a word "cow B"!

ASP after so many years of hammering, some of their own difficult to overcome defects also gradually surfaced, at this time to listen to his words, excitedly a trot immediately. NET, but a few flashes. NET Golden Halo Project after the shot, the results are not satisfactory, so the temporary regression back to the ASP, oh, may be the state is not high enough, sigh ...

Because the script belongs to the Object-oriented interpretive language, its execution depends on the host, which inevitably has some inherent deficiencies, such as inefficient execution, the module is not organized in the C + + project handy, especially when the script and HTML mixed, it is difficult to have the courage to look back again. In such cases, the server-side code is part of the component can solve some of the problems, so that the Web page code in addition to a few mechanical component calls, the rest is all DW generated HTML, page coding part of our artists can easily handle.

In addition, we have to admit that VB in the implementation of ASP components have some advantages, now the network popular some of the Web Components are used VB to achieve. Because it is simple to implement, there are some formal similarities with VBScript. It is easy to refer to ASP's built-in objects when you are components of scripting code. So with VC? In fact, as long as you are not unfamiliar to COM, use it as simple, and you see the following implementation, may feel that is not generally simple, because it is a COM component, and we use other components no different, hehe, to try.

1, create a new "ATL project" called Aspcom.

2, set the project options.

Server type: We want to call in ASP, select DLL type;

Attributed: In order to see the implementation of the code more clearly, we are here to temporarily decline MS's kindness, thank you, but this is a thief has a future, of course, just for the construction of Ms COM;

Merge stub: We can combine the proxy/stub implementation of the client to the server;

Support MFC: This, this ... Free of it, hehe;

Support for COM +: We can't use it here;

Related Article

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.