[Component] "component errors occur when COM components are referenced.
Preface?
Recently, when translating audio and text, I encountered an error: "The interoperability type SpeechLib. SpVoiceClass cannot be embedded ". Use the appropriate interface.
Ask the experts to obtain the correct solution.
Add references from the Com group first:
Right-click the introduced Com Component Library and choose properties:
Change the embedded interoperability type to "false ":
Cause of Error Correction
1. The meaning of timely introduction of embedding in "embedded interoperability type" is similar to the function of Using in C # and include in C. The meaning of this attribute
Is to tell the compiler whether to introduce the interoperability type.
2. "Interoperability type" refers to a series of Com group discipline inspection assembly, which is a library file in the public Runtime Library, similar to compiled classes and interfaces.
3. The "embedded interoperability type" is set to true. In fact, the interoperability set is not introduced (the Com assembly is abandoned during compilation), and only the user code is compiled.
Assembly. If it is set to false, the type information of the COM type needs to be obtained from the interoperability program.