Solved

COM and Intterfaces

Posted on 2006-11-12
3
170 Views
Last Modified: 2010-04-01
Hello all,

Why is that when an interface is published and registered in the regsitry, that on subsequent releases that interface cannot be modified in any way? E.g if i were to add a new virtual method at the end of the current methods listed in the intterface?

Thanks
0
Comment
Question by:lcoolsingh
  • 2
3 Comments
 
LVL 11

Expert Comment

by:DeepuAbrahamK
ID: 17928550
Hi,

Well you could very well add a new function in the interface.Only trouble is you need to re- compile the clients which are using that interface.

While designing the interface we should make sure that your interface should be furture proof.

If you understand the COM frame work, you will be able to connect it well.

Hope you got it !

Best Regards,
DeepuAbrahamK
0
 

Author Comment

by:lcoolsingh
ID: 17930158
I understand the COM framework, but say if you've added one method in your interface like this:

interface
{

  void print(int var);
};

You register this interface, and clients are using it. Six months down the line, you want to do this:

interface
{

  void print(const int var); //ADDED const
};

Why cant we do this? The interface is already registered on the client machine, so their is no need for registration.
0
 
LVL 11

Accepted Solution

by:
DeepuAbrahamK earned 50 total points
ID: 17933135
When you change your interface means you are changing your functions(adding/deleting/modifying) or even function signature.Your client only knows *void print(int var)* and not *void print(const int var)*.The call inside the client menthod may not know the new method *void print(const int var)*.So it will fail.Unless you break and repair the client to use *print(const int var)*.

Hope I get across!

Best Regards,
DeepuAbrahamK
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

705 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now