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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Has anyone been able to use the Pro/Engineer VB API in Silverlight

JamesCoons
1-Visitor

Has anyone been able to use the Pro/Engineer VB API in Silverlight

The following code does throws an Exception when calling the Connect method in Silverlight

Dim comObject = System.Runtime.InteropServices.Automation.AutomationFactory.CreateObject("pfcls.pfcAsyncConnection")

Dim conn = comObject.Connect(Nothing, Nothing, Nothing, 1)

The Exception Info is

System.ArgumentException was caught
Message=Value does not fall within the expected range.
StackTrace:
at MS.Internal.ComAutomation.ComAutomationNative.CheckInvokeHResult(UInt32 hr, String memberName, String exceptionSource, String exceptionDescription, String exceptionHelpFile, UInt32 exceptionHelpContext)
at MS.Internal.ComAutomation.ComAutomationNative.Invoke(Boolean tryInvoke, String memberName, ComAutomationInvokeType invokeType, ComAutomationInteropValue[] rgParams, IntPtr nativePeer, ComAutomationInteropValue& returnValue)
at MS.Internal.ComAutomation.ComAutomationObject.InvokeImpl(Boolean tryInvoke, String name, ComAutomationInvokeType invokeType, Object& returnValue, Object[] args)
at MS.Internal.ComAutomation.ComAutomationObject.Invoke(String name, ComAutomationInvokeType invokeType, Object[] args)
at System.Runtime.InteropServices.Automation.AutomationMetaObjectProvider.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result)
at System.Runtime.InteropServices.Automation.AutomationMetaObjectProviderBase.<.cctor>b__4(Object obj, InvokeMemberBinder binder, Object[] args)
at CallSite.Target(Closure , CallSite , Object , Object& , Object& , Object& , Object& )
at CallSite.Target(Closure , CallSite , Object , Object& , Object& , Object& , Object& )
at Microsoft.VisualBasic.CompilerServices.IDOUtils.CreateRefCallSiteAndInvoke(CallSiteBinder Action, Object Instance, Object[] Arguments)
at Microsoft.VisualBasic.CompilerServices.IDOBinder.IDOGet(IDynamicMetaObjectProvider Instance, String MemberName, Object[] Arguments, String[] ArgumentNames, Boolean[] CopyBack)
at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(Object Instance, Type Type, String MemberName, Object[] Arguments, String[] ArgumentNames, Type[] TypeArguments, Boolean[] CopyBack)
at SimpleSilverlightApplication.MainPage.OnConnectClick(Object sender, RoutedEventArgs e)
InnerException: MS.Internal.ComAutomation.ComAutomationObjectException
ErrorCode=-2147024809
Message=INVALID VARIANT TYPE
InnerException:

Meanwhile The following Almost Identical Code works in WPF

Dim comObject =comObject = Microsoft.VisualBasic.Interaction.CreateObject("pfcls.pfcAsyncConnection")

Dim conn = comObject.Connect(Nothing, Nothing, Nothing, 1)

Has anyone been able to connect to Pro/Engineer from a Silverlight Application and How?


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


Top Tags