VB Com Object Using Implements Fails In VBScript 
Author Message
 VB Com Object Using Implements Fails In VBScript

Hi,

In VB 6.0 on a Win2000 machine, I have written a COM dll to be used within
Activer Server Script and it is failing on WinNT, IIS 4.0 but ok on Win2000
IIS 5.0. It is failing on the Server.CreateObject() method, and message I am
getting is:

"Class Does not Support Automation or does not support expected interface"

The problem only happens with COM objects that use the Implement Interface
strategy.  I first wrote a dll with a base interface with stub but no code,
I call this interface IBaseInterface, for example.  I then build a component
with an interface named IDerived interface.

At the top of the IDerived interface class I simply write :

    Implement IBaseInterface

Basically, I am writing a component that uses an abstract interface, and
when this design is used, I get above mentioned error.

Does anyone have any ideas.

Thanks,

Louis



Mon, 21 Apr 2003 01:22:11 GMT  
 VB Com Object Using Implements Fails In VBScript

VBScript knows only the default interface of your coclass

since VB _always_ generates a default interface for each coclass itself :-(
VBS has no chance to see a second or third interface in your coclass

you can do serveral things to manage the problem

1) build a script compatible wrapper class to thecoclass with more than one
interface
2) cast your coclass to your wanted interface with the help of a C++-Dll
which calls QueryInterface explicitly


Quote:
> Hi,

> In VB 6.0 on a Win2000 machine, I have written a COM dll to be used within
> Activer Server Script and it is failing on WinNT, IIS 4.0 but ok on
Win2000
> IIS 5.0. It is failing on the Server.CreateObject() method, and message I
am
> getting is:

it works on IIS5?? i cannot beleave it! are u using ASP+?

Quote:

> "Class Does not Support Automation or does not support expected interface"

> The problem only happens with COM objects that use the Implement Interface
> strategy.  I first wrote a dll with a base interface with stub but no
code,
> I call this interface IBaseInterface, for example.  I then build a
component
> with an interface named IDerived interface.

> At the top of the IDerived interface class I simply write :

>     Implement IBaseInterface

why IDerived???

it is a class - why prefix it with I ?

or do u want to derive one custom interface from another?

this is impossible with VB, u can only derive from IUnknown or IDispatch



Mon, 21 Apr 2003 08:32:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using VBScript COM Object to parse and run VBScripts scriplets

2. Call VB DLL or COM object from within VB COM object or EXE

3. VB COM object causing web site to fail

4. Using COM Objects from VB (Object Picker Dialog)

5. Warning in IE when using custom COM Object and VBScript

6. Using COM object enums in vbscript

7. Using COM Object from VBScript?

8. com object will not read registry when com object called from asp (vb works fine)

9. speed difference between vbscript and vb com object????

10. speed difference between vbscript and vb com object????

11. Empty Arrary when VBScript calls VB COM object.

12. Implement my own class in COM-object

 

 
Powered by phpBB® Forum Software