ASP Components

I wanna know how to make one, it's 200 points cos I'm damn lazy.

I create an ActiveX DLL in vb5, yes ?

Then what ? Do you have example code that I can put in this dll, after I run it through regserv how do I use it ?

I'm looking for a mini guide to creating the worlds simplest asp com object, just something that you can send a string to and the object will add another string to it.

Cheers

Neil
ntollfreeAsked:
Who is Participating?
 
seahpcConnect With a Mentor Commented:
try these code in your class .

dim msgin as string
public sub setstring(string1 as variant)
   msgin = CStr(string1)
end sub

public sub Addstring()
    msgin = msgin & "Hello World"
end sub

public function GetString()
   GetString = msgin
end function

Next compile these codes and build the dll .

Under your asp code try this
<%
   Set test = Server.CreateObject(ProjectName.ClassName)
   test.setstring "tttt"
   test.Addstring
   results = test.GetString
%>
0
 
mcixCommented:
Create an ActiveX DLL Project by using File New and selecting the ActiveX DLL project type.  

By default, when you do this it will create Class Module Named CLASS1.

Insert this code into CLASS1

Private Const gstrSOMESTRING As String = "ADD THIS TO IT..."
Public Function AddAString(vstrFirstString As Variant) As Variant
     AddAString = vstrFirstString & gstrSOMESTRING
End Function

Compile the Project and Register on your Server that has IIS.

Once you have this done, we will move on to calling from ASP
0
 
ntollfreeAuthor Commented:
Hang on, why am I getting the error

Object required: 'Project1' on the CreateObject line ?
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
seahpcCommented:
Please check these .
What is the name of your project you save as .
try opening  the project, goto project menu properties and check .

0
 
seahpcCommented:
Please check these .
What is the name of your project you save as .
try opening  the project, goto project menu properties and check .

0
 
ntollfreeAuthor Commented:
Hang on, why am I getting the error

Object required: 'Project1' on the CreateObject line ?
0
 
ntollfreeAuthor Commented:
it's 'Project1'

Neil
0
 
seahpcCommented:
I think you need this .
<%
  Set ...... = Server.CreateObject("ProjectName.ClassName")
 ....................
0
 
ntollfreeAuthor Commented:
it's 'Project1'

Neil
0
 
ntollfreeAuthor Commented:
Now I get this error on the same line

ActiveX component can't create object


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.