cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

VB API server Configuration

kganesan
1-Newbie

VB API server Configuration

The following error is thrown when creo connection string is accessed from web browser.


Retrieving the COM class factory for component with CLSID {456E0110-2031-3907-AFE5-9201C97A915E} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).


An aspx page is developed and the following code is added. but it throws the above mentioned error.


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim asyncConnection As IpfcAsyncConnection = Nothing

        Dim cAC As CCpfcAsyncConnection

        Dim session As IpfcBaseSession

        Dim exePath = "D:\Program Files\PTC\Creo 2.0 M020\Creo 2.0\Parametric\bin\parametric.exe"

        Try

            '======================================================================

            'First Argument : The path to the Creo Parametric executable along with

            ' Command() line options. -i and -g flags make Creo Parametric run in

            ' non-graphic, 'non-interactive mode.

            'Second Argument: String path to menu and message files.

            '======================================================================

            cAC = New CCpfcAsyncConnection

            asyncConnection = cAC.Start(exePath + "-g:no_graphics -i:rpc_input", ".")

            'asyncConnection = (New CCpfcAsyncConnection).Connect(Nothing, Nothing, Nothing, Nothing)

            'asyncConnection = (New CCpfcAsyncConnection).Connect(Nothing, Nothing, Nothing, Nothing)

            session = asyncConnection.Session

            Label1.Text = "Success"

        Catch ex As Exception

            Label1.Text = ex.Message

        End Try

    End Sub


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.
7 REPLIES 7

Hi,

Sometimes creo session is not getting connected with argument as Nothing. Try following code snippet and let me know your results:

Try

_objIpfcConnection = objCCpfcConnection.Connect(Nothing, Nothing, Nothing, Nothing)

Catch

Try

_objIpfcConnection = objCCpfcConnection.Connect(DBNull.Value, DBNull.Value, DBNull.Value, DBNull.Value)

Catch

End Try

End Try

Regards

Ketan

Hi Ketan,

how to declare the objCCpfcConnection and _objIpfcConnection


Thanks,

Hi,

dim _objIpfcConnection As IpfcAsyncConnection

dim objCCpfcConnection As New CCpfcAsyncConnection

With this declaration, you should be able to get session object.

One assumption is that creo should be open while accessing session with above method. You can do below to start creo:

dim processcreo As Process = New Process()

Dim startInfo As New ProcessStartInfo

startInfo.WorkingDirectory() = 'Set your creo working directory path'

startInfo.FileName = 'Set creo's exe file path

Process.Start(startInfo) 'starts creo

Thread.Sleep(15000) 'waits for 15 seconds: increase this timing if your code need to be worked on system having less RAM

Hope this will work for you.

Regards

Ketan

I am getting the following error.

pfcExceptions::XToolkitGeneralError

on which line?

This is error code thrown...

i was able to launch as windows application but unable to launch through web browser. do you have guide to setup the web based server

Top Tags