Click here to Skip to main content
15,888,527 members
Home / Discussions / C#
   

C#

 
QuestionCreate .NET COM dll as existing C++ COM Pin
MrKBA24-Aug-17 22:38
MrKBA24-Aug-17 22:38 
AnswerRe: Create .NET COM dll as existing C++ COM Pin
Pete O'Hanlon24-Aug-17 22:44
mvePete O'Hanlon24-Aug-17 22:44 
GeneralRe: Create .NET COM dll as existing C++ COM Pin
MrKBA25-Aug-17 0:41
MrKBA25-Aug-17 0:41 
GeneralRe: Create .NET COM dll as existing C++ COM Pin
Pete O'Hanlon25-Aug-17 0:57
mvePete O'Hanlon25-Aug-17 0:57 
GeneralRe: Create .NET COM dll as existing C++ COM Pin
User 1106097925-Aug-17 9:25
User 1106097925-Aug-17 9:25 
GeneralRe: Create .NET COM dll as existing C++ COM Pin
MrKBA27-Aug-17 22:20
MrKBA27-Aug-17 22:20 
QuestionInterface extensions: Guaranteed maintenance problem? Pin
jschell24-Aug-17 6:58
jschell24-Aug-17 6:58 
AnswerRe: Interface extensions: Guaranteed maintenance problem? Pin
Dave Kreskowiak24-Aug-17 9:33
mveDave Kreskowiak24-Aug-17 9:33 
As I understood it, you have an Interface that you want to add something to.
C#
public interface ISomething
{
    void SomeMethod();     // Existing method signature.
    void NewMethod();      // New method signature to add. This would be nice but is a breaking change!
}

You can't add anything to the interface because this is a breaking change to all implementing classes of that interface. All the classes would be required to supply an implementation of the NewMethod.

This is where Interface Extensions come in. In order for this to work and not be a breaking change to all existing implementors, the new method signature in the Interface would have to supply a default implementation. The problem with this is that you can only use the terms of the existing Interface you're extending.
C#
// Syntax here is arbitrary and not representative
// of any working implementation.

public interface ISomething
{
    void SomeMethod();     // Existing method signature.
}


// Now extend the above interface...
public extension interface ISomethingEx : ISomething
{
    void NewMethod()
    {
        ... some default implementation;
    }
}

I can see the up-side to this, but the downside is you're getting into what an Interface isn't, an implementation. I agree that this would be something that could easily be abused, making the code much harder to read, follow, and debug.
System.ItDidntWorkException: Something didn't work as expected.

A guide to posting questions on CodeProject

Click this: Asking questions is a skill.
Seriously, do it.

Dave Kreskowiak

AnswerRe: Interface extensions: Guaranteed maintenance problem? Pin
Bernhard Hiller24-Aug-17 21:45
Bernhard Hiller24-Aug-17 21:45 
QuestionString Format With $ Pin
Kevin Marois24-Aug-17 5:49
professionalKevin Marois24-Aug-17 5:49 
AnswerRe: String Format With $ Pin
Pete O'Hanlon24-Aug-17 6:46
mvePete O'Hanlon24-Aug-17 6:46 
GeneralRe: String Format With $ Pin
Kevin Marois24-Aug-17 6:47
professionalKevin Marois24-Aug-17 6:47 
AnswerRe: String Format With $ Pin
Bernhard Hiller24-Aug-17 21:50
Bernhard Hiller24-Aug-17 21:50 
PraiseRe: String Format With $ Pin
Richard Deeming25-Aug-17 2:04
mveRichard Deeming25-Aug-17 2:04 
GeneralRe: String Format With $ Pin
Bernhard Hiller25-Aug-17 2:30
Bernhard Hiller25-Aug-17 2:30 
GeneralRe: String Format With $ Pin
BillWoodruff26-Aug-17 5:20
professionalBillWoodruff26-Aug-17 5:20 
GeneralRe: String Format With $ Pin
Bernhard Hiller28-Aug-17 3:25
Bernhard Hiller28-Aug-17 3:25 
QuestionEverything works fine in the Crystal-report, only the image does not display Pin
goldsoft23-Aug-17 23:37
goldsoft23-Aug-17 23:37 
QuestionANPR Pin
Member 1311476923-Aug-17 18:38
Member 1311476923-Aug-17 18:38 
AnswerRe: ANPR Pin
Pete O'Hanlon23-Aug-17 21:06
mvePete O'Hanlon23-Aug-17 21:06 
AnswerRe: ANPR Pin
Gerry Schmitz26-Aug-17 8:39
mveGerry Schmitz26-Aug-17 8:39 
QuestionHow would I go about implementing this in my code/program? Pin
Delaney Perkins22-Aug-17 22:18
Delaney Perkins22-Aug-17 22:18 
AnswerRe: How would I go about implementing this in my code/program? PinPopular
Chris Quinn22-Aug-17 23:09
Chris Quinn22-Aug-17 23:09 
AnswerRe: How would I go about implementing this in my code/program? Pin
OriginalGriff22-Aug-17 23:23
mveOriginalGriff22-Aug-17 23:23 
AnswerRe: How would I go about implementing this in my code/program? Pin
Pete O'Hanlon23-Aug-17 0:00
mvePete O'Hanlon23-Aug-17 0:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.