Get VBAPI to work
Hello,
I've managed to setup the vbapi on my computer, but I still get an error when I want to test my first program. Basically this program just connects to Creo Parametrics 2.0:
Imports pfcls
Public Class formCreo
Dim asyncConnection As IpfcAsyncConnection = Nothing
Dim cAC As CCpfcAsyncConnection
Dim session As IpfcBaseDimensions
Private Sub btnConnect_Click(sender As Object, e As EventArgs) Handles btnConnect.Click
cAC = New CCpfcAsyncConnection()
asyncConnection = cAC.Connect(Nothing, Nothing, Nothing, Nothing)
session = asyncConnection.Session
End Sub
End Class
When I click on the button btnConnect I want the program to connect to PTC Creo 2.0 (which is running in the background). Unfortunately an error occurs which says something like (I've got the german version of Visual Studio Express 2013 - so I try to translate the error as correct as possible)
A first chance exception of type "System.InvalidCastException" occured in Creo_VB-Testprojekt.exe.
Additional Information: Unable to cast COM object of type "System.__ComObject" to interface type "pfcls.IpfcBaseDimensions". This operation failed because the QueryInterface call on the COM component for the interface with IID "{FB2B3DD7-6456-39CE-B45C-668B7907BF5D}" failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))
Since my vb code is nearly an exact copy of the standard code examples, and I don't see any line of code that has to do anything with IpfcBaseDimensions, I suppose that this error occurs in a standard routine, which is started while establishing the connection to Creo. Therefore it would be a problem with the vbapi setup? Unfortunately I'm not able to fix this problem. I tried to google similar problems, but none of the suggested solutions worked for me nor offered me clues for the cause of this problem. So I would be thankful for any suggestions!
Thanks in advance!
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

