Link to home
Start Free TrialLog in
Avatar of ascot
ascot

asked on

ATL - IDispatchImpl wMajor and wMinor parameters.

What are the IDispatchImpl wMajor and wMinor parameters used for ?  Documentation says major version and minor version of the type library.
When I build my ATL object, my header file contains
public IDispatchImpl<Ihereisone, &IID_Ihereisone, &LIBID_YETANOTHERLib>  so it picks up the default major and minor numbers, 1 and 0.

So I modified my header file as follows and rebuilt my ATL COM object:-
public IDispatchImpl<Ihereisone, &IID_Ihereisone, &LIBID_YETANOTHERLib> ,5, 6)

I then use OLE viewer to see what changed - but nothing appears to have changed.  Are they used ?
Avatar of jkr
jkr
Flag of Germany image

>>I then use OLE viewer to see what changed - but nothing appears to have changed.

That kind of version info refers to the type library that is described by 'LIBID_YETANOTHERLib', not the one you are currently building.
Avatar of novitiate
novitiate

its due to following lines in your code. Though the version of that particular component is changed, your lib is still v1.0, you need to change this first before you change the component. also helpstring.

[
      uuid(7C0EFE60-3912-4DAC-9658-FCBDC6B5EC74),
      version(1.0),
      helpstring("atlcomp 1.0 Type Library")
]
library YETANOTHERLib
....
....

_novi_
in your idl file.

_novi_
Avatar of ascot

ASKER

Thanks jkr
Re "That kind of version info refers to the type library that is described by 'LIBID_YETANOTHERLib', not the one you are currently building."
Sorry I don't understand - there is only one type library in my project and that is yetanother.tlb.

Thanks novitate but I don't actually want to change the version of my lib - what I am interested in is
1) the fact that ATL just defaults the IDispatchImpl major and minor numbers and
2) and I guess this is the crux of the question - if I change the major and minor version numbers, what changes in the COM Client ?  i.e. if it is a major and minor version number for that specific interface, how does a Client load a particular version ?
Avatar of ascot

ASKER

When I alter the major and minor number, it doesn't appear to change any uids and CoCreateInstanceEX doesn't have a mjor and minor version number - so by chaging it what am I affecting ?
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial