Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a class within a class 1

Status
Not open for further replies.

jamieslover

Programmer
Feb 4, 2002
16
US
I created an active x dll with a class named FixedOutput, one of it's properties is defined as another class called EportSpecs So I could use two dots like this:

myReport.ExportSpecs.HeaderDateFormat = "mmdd"

Everything worked great in the visual basic environment, but when I compiled it and tried to use it from my ASP application it didn't recognize give me intelisense on the second dot. (I've never read any books on VB or anything, so I don't know the lingo, sorry.)
 
If anyone could help me out it would be greatly appreciated.
 
You need to register the dll on your web server.
copy the dll to a directory on the webserver. I usually use inetpub\scripts\NAMEOFAPP

now open up a command prompt on the web server.
type:
regsvr32 <fullpath to your dll>\Nameofdll.dll

You should now see a message box saying register succeeded.
Now try it again. Gilbert M. Vanegas
Programmer Analyst III
County of San Bernardino - ISD
Email : gvanegas@isd.sbcounty.gov
 
The dll is registered. I recieve intelisense after I type in &quot;myReport.&quot;
but after &quot;ExportSpecs.&quot; There is nothing :(
 
Not sure exactly what you are trying to do.
But I took a few minutes and came up with...

In VB
Project1 is a project that references your dll project
it has a form with a command button as follows.
Private Sub Command1_Click()
Dim objMyReport As myReport
Set objMyReport = New myReport
MsgBox objMyReport.ExportSpecs.HeaderFormat
End Sub

Here is your activex dll project called WEBDLL with 2 class modules.

MyReport is the &quot;base class&quot; that can contain a class called ExportSpecs and the class is returned as a property so...

(Class MYReport)
Public Property Get ExportSpecs() As ExportSpecs
Set ExportSpecs = New ExportSpecs
End Property

ExportSpecs has a property called HeaderFormat (lets say it returns a string in this example).
(Class ExportSpecs)
Public Property Get HeaderFormat() As String
HeaderFormat = &quot;Hello World&quot;
End Property

That worked fine in visual basic from a form calling the activex dll.

Now in your web environment you would compile the activeX dll and make sure its registered on the web server.
IF YOU WANTED INTELLISENSE ON THIS DLL I believe you would set the reference to the dll from your interdev project.
(Project->ProjectReferences) and select your compiled and registered dll.

Here is an explanation of Project->ProjectReferences from the visual interdev help.
&quot;Use this dialog box to choose the type libraries used for statement completion in the HTML Editor and Code Editors. Type libraries contain the properties, methods, and events for controls and other objects installed on your machine.&quot;

That seems to work for me. Or dont worry about the intellisense and simply code it as follows...
Your asp code would look something like...
dim objMyReport
set objMyReport = Server.CreateObject(&quot;WEBDLL.MyReport&quot;)
response.write objMyReport.ExportSpecs.HeaderFormat

That should work also...




Gilbert M. Vanegas
Programmer Analyst III
County of San Bernardino - ISD
Email : gvanegas@isd.sbcounty.gov
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top