Create a Visual Basic COM component to use in ASP

Source: Internet
Author: User
Tags object model
Profile
This step-by-step article describes how to create a Component Object Model (COM) component for use in Active Server Pages (ASP).


COM components for use by ASP
Create a new ActiveX DLL project in Visual Basic.
Name the project VBASPProject and name the class Vbaspclass.
Paste the following public methods into the class module:
Public Function GetString () as String
' Return the string Hello world!
GetString = "Hello world!"
End Function
From the File menu, click Build VBASPProject.dll to compile the dynamic link library (DLL).
Create a new ASP file in Notepad and paste the following code:
<%
Set obj = Server.CreateObject ("Vbaspproject.vbaspclass")
Response.Write obj. GetString
%>
Save the ASP file in a virtual directory that is a Microsoft Internet information Server (IIS) Web application.
Run the ASP page in a Web browser. "Hello world!" will be displayed Text.
Reference
The above is just a very brief example.

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.