
Using Interfaces in an VB 6 DLL in VBScript
I am using ASP and
VBScript to talk to a VB 6 ActiveX DLL and simply cannot
get VBScript to work with any of the implemented interfaces in my DLL.
In my case, I have an interface called IFolder and one of the
implementations of this is MessageFolder. IFolder has properties like Name,
FolderType, Items and MessageFolder simply implements all of these.
I have a function in the DLL called GetCurrentFolder that returns one of the
implementations as IFolder - something like:
Public Function GetFolder() as IFolder
Set GetFolder = mCurrentFolder
End Function
VBScript does not find any of the properties for this object because it is
looking at the base object (MessageFolder) which has no properties. This
really does not make any sense because I passed it the IFolder interface
pointer! If I add a function to MessageFolder itself called Name that
simply calls the interface it works fine, but I don't really want to do
this.
The only help I found on this was the knowledge base article Q188716
( http://www.*-*-*.com/ ) which
pretty much recommended what I was already doing (return something typed as
the proper interface) which does NOT work. I even followed the steps in the
article that demonstrated the fix and that did not work either.
So does anyone know how to make this work without having to write stub
properties in MessageFolder that calls the IFolder interface? It seems like
a real pain to have to maintain the useless properties.
Thanks!
Chris Kaczor