[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
vbcreatecom
Add any references that you might need, such as ADO for database use. More importantly Add the COM+ reference (Windows 2k)
Change the Project name from Project1 to something that suits the project. For this example lets change it to:
PrjExample
Change the class name from the default also to something more meaningful. Again lets follow the scheme and change it to:
ClsExample
With the foundations set. Lets create a Function to test our DLL.
Compile the DLL.
Put VB in Run Mode. (This is the quick way)
Create an ASP with an editor of your choice.
Save this file on your Web Server directory and open it with a browser to see the result.
VB FAQ
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
vbcreatecom
How do I create A Visual Basic COM Component?
Create a new project. Choose Active X DLL as the project type Uncheck Upgrade controls from Project options.Add any references that you might need, such as ADO for database use. More importantly Add the COM+ reference (Windows 2k)
Change the Project name from Project1 to something that suits the project. For this example lets change it to:
PrjExample
Change the class name from the default also to something more meaningful. Again lets follow the scheme and change it to:
ClsExample
With the foundations set. Lets create a Function to test our DLL.
Public Function ExampleFunc(ByVal ExampleString, ByVal RtnStr) As Integer Rtnstr = ExampleString & “ “ & “ “ Is Passed back to you “ & VBCrlf End Function
Compile the DLL.
Put VB in Run Mode. (This is the quick way)
Create an ASP with an editor of your choice.
<%@ Language=VBScript %>
<% Option Explicit %>
<HTML>
<HEAD>
Dim objExample
Dim RtnStr
Set objExample = CreateObject("prjExample.clsExample")
</HEAD>
<FORM Method="POST" Action="Example.asp" name=form1>
<BODY>
<%
Call objExample.ExampleFunc(“Text From this page ”,RtnStr)
Response.Write(“RtnStr”)
Set objExample = Nothing
%>
</BODY>
</FORM
</HTML>
Save this file on your Web Server directory and open it with a browser to see the result.
VB FAQ
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
