Subtle crashes [modified]
-
Original code:
[ComVisible(true)]
[Guid(".....")]
interface IDocument
{
public void Method1();public Property1 { get; }
}Note:- a valid Guid was supplied. After some months:
[ComVisible(true)]
[Guid(".....")]
interface IDocument
{
public Property1 { get; }public void Method1();
}VSS Comments: Changed the member order to conform to coding standards. The second code breaks lot of existing clients. Can anyone tell me why?:)
modified on Saturday, March 21, 2009 9:20 AM
-
Yes. I am glad that someone still remembers COM concepts:) While in .NET method and interface binding is via name for COM clients it's via vtable so all native clients which used COM interface crashed.
-
Yes. I am glad that someone still remembers COM concepts:) While in .NET method and interface binding is via name for COM clients it's via vtable so all native clients which used COM interface crashed.
COM sucketh, don't use it.
-
COM sucketh, don't use it.
PIEBALDconsult wrote:
COM sucketh, don't use it.
Or just follow the COM rules, one of which is "if you change the interface in any way, change it's UUID as well".
-
Original code:
[ComVisible(true)]
[Guid(".....")]
interface IDocument
{
public void Method1();public Property1 { get; }
}Note:- a valid Guid was supplied. After some months:
[ComVisible(true)]
[Guid(".....")]
interface IDocument
{
public Property1 { get; }public void Method1();
}VSS Comments: Changed the member order to conform to coding standards. The second code breaks lot of existing clients. Can anyone tell me why?:)
modified on Saturday, March 21, 2009 9:20 AM
-
Rama Krishna Vavilala wrote:
interfact
Surprised it compiled at all...
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
It's a new keyword in C# 4.0 ;)
-
COM sucketh, don't use it.
Large chunks on the OS are exposed using COM. For many jobs COM is the way to go, regardless of the language used. COM does not "sucketh".
Steve
-
Original code:
[ComVisible(true)]
[Guid(".....")]
interface IDocument
{
public void Method1();public Property1 { get; }
}Note:- a valid Guid was supplied. After some months:
[ComVisible(true)]
[Guid(".....")]
interface IDocument
{
public Property1 { get; }public void Method1();
}VSS Comments: Changed the member order to conform to coding standards. The second code breaks lot of existing clients. Can anyone tell me why?:)
modified on Saturday, March 21, 2009 9:20 AM
vtable binding. :doh:
Don't attribute to stupidity what can be equally well explained by buerocracy.
My latest article | Linkify!| FoldWithUs! | sighist -
Original code:
[ComVisible(true)]
[Guid(".....")]
interface IDocument
{
public void Method1();public Property1 { get; }
}Note:- a valid Guid was supplied. After some months:
[ComVisible(true)]
[Guid(".....")]
interface IDocument
{
public Property1 { get; }public void Method1();
}VSS Comments: Changed the member order to conform to coding standards. The second code breaks lot of existing clients. Can anyone tell me why?:)
modified on Saturday, March 21, 2009 9:20 AM
:confused:
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
-
COM sucketh, don't use it.
Writing non trivial office plugins in VBA sucketh worse. COM is a much better alternative.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots. -- Robert Royall
-
Large chunks on the OS are exposed using COM. For many jobs COM is the way to go, regardless of the language used. COM does not "sucketh".
Steve
COM does indeed sucketh, but sinceth it's the only game in town for certain things, get used to the vacuum.
Software Zen:
delete this;
Fold With Us![^]