Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: instantiate my interface


Message #1 by "Dimitry" <ivrakas@n...> on Thu, 28 Jun 2001 14:07:56 -0400
I created a com object in vb, and have defined my interface in a class

module.



When instantiating the component in VB



I alias the interface



dim coclass as coclass

dim interface as interface

set coclass = new object.coclass

set Interface = coclass



How do I perform the same task in ASP



when I use



set Object = server.Createobject("object.Interface")

it raises a error asp 0169



but when I use



set object = server.createobject("object.coclass")



no error accurse, but I cant get to my properties and methods except for the

ones I declared public



How can I alias my interface in asp to access my methods.



like i did in VB.





Message #2 by "sabba" <sabbadin@i...> on Thu, 28 Jun 2001 20:30:19 +0200
you can't, you can access only the interface marked as default from asp (in

case the component is written in vb this means that

you cannot access the interfaces you implemented with the implements

keyword.



esabbadin@v...

MTS / COM+ / VBCOM FAQ (and more) : www.sabbasoft.com/mts_faq.htm





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

From: "Dimitry" <ivrakas@n...>

To: "ASP components" <asp_components@p...>

Sent: Thursday, June 28, 2001 8:07 PM

Subject: [asp_components] instantiate my interface





> I created a com object in vb, and have defined my interface in a class

> module.

>

> When instantiating the component in VB

>

> I alias the interface

>

> dim coclass as coclass

> dim interface as interface

> set coclass = new object.coclass

> set Interface = coclass

>

> How do I perform the same task in ASP

>

> when I use

>

> set Object = server.Createobject("object.Interface")

> it raises a error asp 0169

>

> but when I use

>

> set object = server.createobject("object.coclass")

>

> no error accurse, but I cant get to my properties and methods except for

the

> ones I declared public

>

> How can I alias my interface in asp to access my methods.

>

> like i did in VB.

>
Message #3 by "Denis J. Lanza" <voxman@s...> on Thu, 28 Jun 2001 15:08:42 -0400
  This is due to the fact that although VB can use custom interfaces,

scripting languages can only access the Automation/IDispatch interface on

your component. It cant communicate with a custom interface cuz it can't

directly bind to a vtable thus IDispatch takes orders from the scripting

language via calls to GetIDsOfNames() and, subsequently, Invoke(funcid). VB

creates dual interfaces automatically and the Automation interface, (which

is marked as the default interface for the coclass in the IDL), is named

_CoClassName. Therefore, when you create an instance of the object in ASP

via script, it uses the IDispatch interface only which it accesses via the

call to createobject("projectname.coclassname"). Let me know if this helps

or if my explanation needs clarification cuz I can go much deeper into this

with you if you'd like.



Sincerely,

Denis J. Lanza MCP+I,MCP+SB,MCSD,MCSE





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

From: Dimitry [mailto:ivrakas@n...]

Sent: Thursday, June 28, 2001 2:08 PM

To: ASP components

Subject: [asp_components] instantiate my interface





I created a com object in vb, and have defined my interface in a class

module.



When instantiating the component in VB



I alias the interface



dim coclass as coclass

dim interface as interface

set coclass = new object.coclass

set Interface = coclass



How do I perform the same task in ASP



when I use



set Object = server.Createobject("object.Interface")

it raises a error asp 0169



but when I use



set object = server.createobject("object.coclass")



no error accurse, but I cant get to my properties and methods except for the

ones I declared public



How can I alias my interface in asp to access my methods.



like i did in VB.


  Return to Index