Error message using Inventor Apprentice in Visual Studio 2005

Error message using Inventor Apprentice in Visual Studio 2005

Anonymous
Not applicable
605 Views
5 Replies
Message 1 of 6

Error message using Inventor Apprentice in Visual Studio 2005

Anonymous
Not applicable
Hi -

I've done some looking through the site and on the Internet trying to find a solution to a problem with a VB.NET application I'm attempting to create. Unfortunately, I'm stumped by an error message that has prevented me from moving forward with any Inventor customizations.

Tools: Visual Studio 2005 sp1, Inventor 11 Stand Alone install
OS: Windows Vista 64 sp1

I installed the developer tools under the SDK folder. I then added a reference in my VB.NET project in COM to the component named: AutoDesk Inventor Object Library. It appears under references for my project as:

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

My code is as follows:

{code}
'// 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
{code}

When I execute it, I get the following message:

Retrieving the COM class factory for component with CLSID {C343ED84-A129-11D3-B799-0060B0F159EF} failed due to the following error: 80040154

Any suggestions? Edited by: rschmaltz on May 13, 2009 7:48 PM (added code tags)
0 Likes
606 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
>>Reference Name: Autodesk Inventor Object Library Type: COM Version: 1.0.0.0

You added the COM reference? I use 2009, but I'd imagine 11 would be similar. Don't add the COM reference in the Visual Studio Add Reference COM tab. Instead browse to and use just that SDK Reference DLL. That DLL should be a .NET reference, not COM.
0 Likes
Message 3 of 6

Anonymous
Not applicable
Thanks for the input. I tried browsing directly to the file, but I get the same error message even though the reference now says, ".NET."

Is it possible there is a conflict between vista 64 and this 32-bit DLL?
0 Likes
Message 4 of 6

Anonymous
Not applicable
Try compiling strictly in x86 mode instead of Any CPU. Inventor 11's a 32 bit application, isn't it?
0 Likes
Message 5 of 6

Anonymous
Not applicable
Just tried that and it works. I wonder what that means as far as my x64 clients now. Does that just mean it'll have to run in 32-bit compatibility mode?
0 Likes
Message 6 of 6

Anonymous
Not applicable
I think if your clients are all using Inventor 11, it shouldn't be a problem. It will, however, not work in 64 bit versions of Inventor. I don't remember what version it starts to be an issue with, but I know it will with 2009 and 2010. The 64 bit versions of those will not load a 32 bit compiled DLL and vise versa, but they're good with AnyCPU compiled DLLs.
0 Likes