Skip to main content
1-Visitor
August 13, 2015
Question

VB API server Configuration

  • August 13, 2015
  • 1 reply
  • 3060 views

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.

1 reply

1-Visitor
September 9, 2015

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

kganesan1-VisitorAuthor
1-Visitor
September 9, 2015

Hi Ketan,

how to declare the objCCpfcConnection and _objIpfcConnection


Thanks,

1-Visitor
September 9, 2015

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