I'm trying to get into COM interoperability
So there is a simple example:
SpeechLib.SpVoice voice = new SpVoice(); voice.Speak("Hello sucker!",SpeechVoiceSpeakFlags.SVSFDefault);
Of course, I have to add the link to% windir% \ system32 \ speech \ common \ sapi.dll before, and VS will add Interop.SpeechLib.dll to the project folder, and now I need to distribute this 200kb library using my simple 4kb application.
Is it possible to use [DllImport] instead of adding a link, because in most cases the speech library is already present on the client computer?
Could you show me how to rewrite the code above using the DllImport method?
source share