Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: metadata and TLB File


Message #1 by "robiyanto surya" <robiyantos@h...> on Fri, 22 Jun 2001 03:00:11
Hi everyone,



I tried to create a DLL file (COM) using VB6. This file only contains 

constant variables such as:



...

Const a = 10

...



Then I compile this file into dll. I already checked on Project-

>Properties->Component Tab->Remote File Server to get the TLB file.



I want to use this constant from my asp file with using METADATA tag, such 

as:

<%

...



<!--METADATA TYPE="TypeLib" uuid="{DCC89F17-61CB-4A15-A12D-C61F1626CD8D}" -

->



Response.Write a

...

%>



I got the uuid from ther registar editor (this is correct number).

However, when I tried to print "a", it did not appear on the screen.

There is no error message.



I also already tried like this:

<%

...



<!--METADATA TYPE="TypeLib" FILE="location of my TLB file" -->



Response.Write a

...

%>



It still did not print a on the screen.

I also already change syntax for "const a" in my vb file(dll file) to :



...

Public Property Get a() As Integer

    a = 10

End Property

...



It still did not work.



I tried to add word "Public" in front of constant a, but It does not work 

in VB6.



Does anyone know how to create a global constant that can be used by asp 

file with using TLB file and METADATA tag ?





Thank You,



Robi



Message #2 by "Balajewicz, Greg" <Greg.Balajewicz@A...> on Fri, 22 Jun 2001 07:35:58 -0500

I am guessing: when you are doing

	Response.Write a

and do not have option exlicit, asp will just try to print the contents 

of a

variable 'a' which does not exists of course. Try qualyfying a with the

project name or something like that. I have never done this so I cannot 

be

100% sure.



-----Original Message-----

From: robiyanto surya [mailto:robiyantos@h...]

Sent: Thursday, June 21, 2001 11:00 PM

To: ASP components

Subject: [asp_components] metadata and TLB File





Hi everyone,



I tried to create a DLL file (COM) using VB6. This file only contains

constant variables such as:



...

Const a =3D 10

...



Then I compile this file into dll. I already checked on Project-

>Properties->Component Tab->Remote File Server to get the TLB file.



I want to use this constant from my asp file with using METADATA tag, 

such

as:

<%

...



<!--METADATA TYPE=3D"TypeLib" 

uuid=3D"{DCC89F17-61CB-4A15-A12D-C61F1626CD8D}" -

->



Response.Write a

...

%>



I got the uuid from ther registar editor (this is correct number).

However, when I tried to print "a", it did not appear on the screen.

There is no error message.



I also already tried like this:

<%

...



<!--METADATA TYPE=3D"TypeLib" FILE=3D"location of my TLB file" -->



Response.Write a

...

%>



It still did not print a on the screen.

I also already change syntax for "const a" in my vb file(dll file) to :



...

Public Property Get a() As Integer

    a =3D 10

End Property

...



It still did not work.



I tried to add word "Public" in front of constant a, but It does not 

work

in VB6.



Does anyone know how to create a global constant that can be used by 

asp

file with using TLB file and METADATA tag ?





Thank You,



Robi





Message #3 by David Cameron <dcameron@i...> on Mon, 25 Jun 2001 09:54:35 +1000

Try creating the variables as properties of your class object. This means

using a statement in the VB project like this:



Public Property Get Result() As String

    Result = gstrResult

End Property



When you have created your object in the ASP page (using Set MyObj 

Server.CreateObject("MyProject.MyClass") ) then you do something like this:



Response.Write(MyObj.Result)



The only question I have is why you would want to dump constants in a dll.

There would a hit on server performance to create the object and use the

object. Why not just create an include file with values in it? Is there some

issue with people accessing your source code?



regards

David Cameron

nOw.b2b

dcameron@i...



-----Original Message-----

From: Balajewicz, Greg [mailto:Greg.Balajewicz@A...]

Sent: Friday, 22 June 2001 10:36 PM

To: ASP components

Subject: [asp_components] RE: metadata and TLB File







I am guessing: when you are doing

	Response.Write a

and do not have option exlicit, asp will just try to print the contents 

of a

variable 'a' which does not exists of course. Try qualyfying a with the

project name or something like that. I have never done this so I cannot 

be

100% sure.



-----Original Message-----

From: robiyanto surya [mailto:robiyantos@h...]

Sent: Thursday, June 21, 2001 11:00 PM

To: ASP components

Subject: [asp_components] metadata and TLB File





Hi everyone,



I tried to create a DLL file (COM) using VB6. This file only contains

constant variables such as:



...

Const a =3D 10

...



Then I compile this file into dll. I already checked on Project-

>Properties->Component Tab->Remote File Server to get the TLB file.



I want to use this constant from my asp file with using METADATA tag, 

such

as:

<%

...



<!--METADATA TYPE=3D"TypeLib" 

uuid=3D"{DCC89F17-61CB-4A15-A12D-C61F1626CD8D}" -

->



Response.Write a

...

%>



I got the uuid from ther registar editor (this is correct number).

However, when I tried to print "a", it did not appear on the screen.

There is no error message.



I also already tried like this:

<%

...



<!--METADATA TYPE=3D"TypeLib" FILE=3D"location of my TLB file" -->



Response.Write a

...

%>



It still did not print a on the screen.

I also already change syntax for "const a" in my vb file(dll file) to :



...

Public Property Get a() As Integer

    a =3D 10

End Property

...



It still did not work.



I tried to add word "Public" in front of constant a, but It does not 

work

in VB6.



Does anyone know how to create a global constant that can be used by 

asp

file with using TLB file and METADATA tag ?





Thank You,



Robi





Message #4 by "Geoff Higgins" <geoff@v...> on Tue, 26 Jun 2001 09:22:45 +0100
Make sure that any property of the DLL that you want to expose is declared

Public.



Geoff




  Return to Index