Re: Why VB doesn't handle Implements Interface same in Compiled and VBIDE?
From: Rany ElHousieny [MSFT] (ranyel_at_online.microsoft.com)
Date: 06/30/04
- Next message: Mark G. Meyers: "Re: various objects in my VB6 project - Calling IUnknown"
- Previous message: SHA: "Re: How to call an "exe" aplication inside a VBScript Subroutine?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 30 Jun 2004 09:58:30 -0700
You have to use type VARIANT for VBS or you will get Typemissmatch
This posting is provided "AS IS" with no warranties, and confers no rights
"Nikola Bozovic" <not-for-mail> wrote in message
news:uizZUCVPEHA.2256@TK2MSFTNGP10.phx.gbl...
>I have big problem !?
>
> I have ONE tlb with interface declaration,
> and have created EXE project that created ActiveX class (ServerClass) from
> passed string, like:
> ...
> Public o as object
> ...
> set o = CreateObject(szServerClassName)
> ...
> ok this part works fine!
>
> but now I have referenced TLB typelibrary with interface into this EXE
> Project. I use new declaration of variable for this
> interface, also using
> on error resume next to check if this ServerClass has implemented this
> interface, like this
> ...
> public o as object
> public oi as IInterface
> public useInterface as boolean
> ...
> set o = CreateObject(szServerClassName)
> on Error Resume Next
> set oi = o
> useInterface = not oi is nothing
> if err.number<>0 then err.clear
> on Error Goto ErrorHandler:
> ...
>
> After which I have implemented interface into ServerClass, and that part
> is also ok (group project) and compiled both versions,
> ...
> Implements IInterface
> IInterface_...
> ...
> And everything compiled works fine!
>
> but here is the problem:
> ================
> - when I compile my EXE Project, and load ActiveX DLL ServerClass project
> and I start with full compile, and start COMPILED version
> of EXE Project, nothing woks, compiled EXE Project reports that oi
> (Interface) isn't set (it's nothing), after which I have created
> MsgBox to tell me an error description:
> error #13 - type mismatch!
>
> (both projects are referencing same TLB library)
>
> ??? Why this error occurs only in Compiled vs VBIDE RunTime version,
> and not in Compled vs Compiled and VBIDE vs VBIDE (in group project) ???
>
> I am loosing my gray mass to figure it out
> An idea was to create interface that users can use in their classes, and
> for me easy to call those members in that interface.
>
> Thanks in advance to any clue
>
> [Nikola Bozovic]
>
>
- Next message: Mark G. Meyers: "Re: various objects in my VB6 project - Calling IUnknown"
- Previous message: SHA: "Re: How to call an "exe" aplication inside a VBScript Subroutine?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|