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 ?
ascotAsked:
Who is Participating?
 
jkrCommented:
>>there is only one type library in my project and that is yetanother.tlb

Yes, and that's the one that is checked against the version numbers you specify. Using different values will not affect the ATL object you're building.
0
 
jkrCommented:
>>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.
0
 
novitiateCommented:
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_
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
novitiateCommented:
in your idl file.

_novi_
0
 
ascotAuthor Commented:
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 ?
0
 
ascotAuthor Commented:
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 ?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.