我已经做了一些浏览网站和互联网试图找到我试图创建的VB.NET应用程序的问题的解决方案。不幸的是,我被一条错误信息困扰,这使我无法继续进行任何Inventor自定义。
Tools: Visual Studio 2005 sp1, Inventor 11 Stand Alone install
OS: Windows Vista 64 sp1
我在SDK文件夹下安装了开发人员工具。然后我在COM中的VB.NET项目中添加了一个名为AutoDesk Inventor Object Library的组件的引用。它出现在我的项目的引用下:
Reference Name: Autodesk Inventor Object Library
Type: COM
Version: 1.0.0.0
Copy Local: True
Path: C:\Users\rschmalt\Visual Studio 2005\Projects\
InvTest\InvTest\obj\Debug\Interop.Inventor.dll
我的代码如下:
'Opens Inventor Apprentice session to read part numbers
Dim oApprentice As New Inventor.ApprenticeServerComponent
Dim asmDoc As Inventor.ApprenticeServerDocument
Dim refDoc As Inventor.ApprenticeServerDocument
asmDoc = oApprentice.Open(strIAMLocation)
For Each refDoc In asmDoc.ReferencedDocuments
MessageBox.Show(refDoc.FullFileName.ToString)
Next
当我执行它时,我收到以下消息:
Retrieving the COM class factory for component with CLSID {C343ED84-A129-11D3-B799-0060B0F159EF} failed due to the following error: 80040154
我已经尝试直接浏览到DLL(Interop.Inventor.dll
),然后它在引用中显示为.NET类型,但错误仍然相同。
vista 64(Inventor 11是32位)之间是否存在冲突?有什么建议吗?