Click to See Complete Forum and Search --> : compiler support for importing typelibs


R.D. Holland
April 29th, 1999, 09:48 AM
When using #import *.tlb with VC++ 5.0 and VC++ 6.0, the two compilers create different signatures for the generated interface member functions that return IDispatch pointers. The 5.0 compiler returns an IDispatch* while the 6.0 compiler returns IDispatchPtr (a "smart" pointer).

Is there a way to force the 5.0 compiler to return smart pointers in these cases too? This is causing a big pain in my development since I have to keep two different sets of source because of this.

Julius Ivanyi
April 29th, 1999, 10:09 AM
Hi
you could write a #define definition which creates IDispatch* or IDispatchPtr depending on the compiler version.
Julius Ivanyi