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