?
Solved

ATL - IDispatchImpl wMajor and wMinor parameters.

Posted on 2005-05-11
6
Medium Priority
?
903 Views
Last Modified: 2013-11-25
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 ?
0
Comment
Question by:ascot
  • 2
  • 2
  • 2
6 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 13979678
>>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
 
LVL 8

Expert Comment

by:novitiate
ID: 13983717
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
 
LVL 8

Expert Comment

by:novitiate
ID: 13983719
in your idl file.

_novi_
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 

Author Comment

by:ascot
ID: 13984307
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
 

Author Comment

by:ascot
ID: 13984349
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
 
LVL 86

Accepted Solution

by:
jkr earned 1500 total points
ID: 13991049
>>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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question