'type mismatch' error using early-binding 
Author Message
 'type mismatch' error using early-binding


I am getting a 'type mismatch' error at run-time using early binding with my
type library.  The problem occurs when I attempt to assign my object to a

VB code:

Public Function Initialize(ByVal xDispatch As Variant) As Long
    Dim MyFoo As MyCustomLibrary.MyClass
    Set MyFoo = xDispatch ' type mismatch error here
End Function

The xDispatch object is passed from a COM server as a VARIANT*.

Here is the .idl:

// .idl for IMyInterface

[ uuid(84ba9771-42eb-4acd-a3fc-534cae749e28),
 helpstring("My Test Type Library")

library MyCustomLibrary

 //  Primary dispatch interface

 [ uuid(27CEBDC1-4E72-11CE-8D59-00805F84E87C),
 interface IMyInterface: IDispatch

  [id(1)] HRESULT DisplayMessage ([in] BSTR lpMessage, [in] long dwMode,
[out, retval] long* lReturn);


 //  Class information
 [ uuid(27CEBDC0-4E72-11CE-8D59-00805F84E87C) ]
 coclass MyClass
  [default] interface IMyInterface:


Does anyone know what is wrong with the type library?  Or is this a VB
limitation?  Or am I doing something else wrong?  BTW, late-binding works
great but I would rather have the IntelliSense available.


Sun, 26 Sep 2004 01:28:52 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Excel early binding, Error 13 - Type mismatch?

2. Excel early binding, Error 13 - Type mismatch?

3. Excel early binding, Error 13 - Type mismatch?

4. type mismatch error '13'????

5. ACC2000:Run Time Error '13': Type Mismatch

6. Run -time error '13' Type Mismatch

7. Run-time error '13': Type mismatch

8. Run-time error '13': Type mismatch

9. Run-time error '13': Type mismatch

10. Urgent: runtime error '13' type mismatch

11. VBScript Error 800a000d, Type mismatch: 'LBound'


Powered by phpBB® Forum Software