If you can do SpVoice speak= new SpVoice() and didn't get an error, then it means SpVoice has a constructor, which means that is is NOT an interface.
views:
160answers:
3EDIT: Ah, I see. Look at the definition of SpVoice:
[CoClass(typeof(SpVoiceClass))]
public interface SpVoice : ISpeechVoice, _ISpeechVoiceEvents_Event
{}
Then look up the CoClass attribute:
A coclass supplies concrete implementation(s) of one or more interfaces. In COM, such concrete implementations can be written in any programming language that supports COM component development, e.g. Delphi, C++, Visual Basic, etc.
I'm not familiar with this, so don't take this as gospel, but it appears that, through compiler magic triggered by the CoClass
attribute, you're instantiating an instance of SpVoiceClass
when it looks like you're instantiating an interface.
Dont take the "I" thing too far. Its just a naming convention. Perhaps spVoice is not an interface. May I know how you concluded spVoice is indeed an interface ?
If it is an interface it cant be instantiated.