How to generate AxInterop files?

一世执手 提交于 2019-12-09 17:23:27

问题


We have a .NET project that relies on an old VB6 OCX (The entire thing was originally VB6 and C++ and we are gradually migrating it all to .Net but we need it working in its present half-migrated state). One of our developers can build the project but no-one else can.

The developer finds that he has references to an interop.foo.dll file and an AxInterop.foo.dll, both of which exist.

I have built the VB6 project and added a reference to the OCX into my copy of the .NET project by browsing to it. I now have a reference to the interop.foo.dll, which exists, but I do not have a reference to the AxInterop.foo.dll and that file does not exist either. I also have errors like "Type 'AxFoo.AxocxFoo' is not defined" which stop the project building.

How would I go about generating this AxInterop.foo.dll file and referencing it? I can see lots of StackOverflow questions about what these files are but nothing saying how they are generated!

Many thanks,

--- Alistair.


回答1:


I have solved it: the solution is to use the aximp.execommand-line tool.

References

  • Equivalent question and answer on a Microsoft forum

  • MSDN page about aximp.exe(Windows Forms ActiveX Control Importer)



来源:https://stackoverflow.com/questions/8122250/how-to-generate-axinterop-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!