![]() ![]() You cannot call any interface methods until the control instance is created, that doesn't happen until you've added the control and the form's Load event has fired. ![]() Next you have to add the control to the form's Controls collection so it is visible and usable. If you have no idea what its name might be, it isn't obvious, then use ildasm.exe to look at the assembly. Next you have to create an instance of the control, use Assembly.CreateInstance() and pass the type name of the AxHost wrapper class. ![]() Now you can use Assembly.Load("") in your code to dynamically load the interop assembly. Best thing to do is to add them to your project and set their Copy to Output Directory to "Copy if newer". Next you have to ensure these DLLs are present in the build directory. And, the interop assembly that makes the COM interfaces implemented by the control callable from a. You'll get two assemblies, contains a wrapper class that's derived from AxHost and allows you to put the control on a form. Use the Visual Studio Command Prompt to run the tool. First and foremost, you have to run the Aximp.exe utility to generate the. You'll have to perform a number of steps that are normally taken of automatically when you use the toolbox.
0 Comments
Leave a Reply. |