|
Simple VB Component by Charles
Carroll
This is a very simple component written in Visual Basic. You
can create it by
- making a new "Active-X DLL" project
- under the Project; References menu, you must activate the
"Microsoft Active Server Pages" library otherwise it won't recognize the
response object and won't compile.
- The project name ==> charlescarroll
The class name ==> simplecomponent
Here is the Visual Basic source code for the
component:
filename=/learn/test/charlescarrollsimplecomponent.cls
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "simpleComponent"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
' projectname =charlescarroll
' classname =simplecomponent
Private ASPresponse As response
Public Sub onstartpage(sc As ScriptingContext)
Set ASPresponse = sc.response()
End Sub
Public Sub hello()
ASPresponse.Write "Hello"
End Sub
Public Sub goodbye()
ASPresponse.Write "Goodbye"
End Sub
Now it is invoked on an ASP page with the following code:
filename=/learn/test/simplevb.asp
<html><head>
<title>simplevb.asp</title></head>
<body bgcolor="#FFFFFF">
<%
set parrot=server.createobject("charlescarroll.simplecomponent")
parrot.hello
response.write "<br>"
parrot.goodbye
%>
</body></html>
 |  |  |
 |
There are many worthy charities!!. But perhaps help starving children in Africa or South America AND help Charles too.
a $5 tip buys him lunch at McDonalds,
a $20 tip buys his kid Hitoshi a new computer game,
a $39 tip buys his daughter Michiko a few nice outfits.
See our donor list.
|  |
 |  |  |
|
|
|
|