on ‎2013 Jun 12 9:53 AM
I have been using Powerbuilder 12.5 and I have migrate an old project from classic to .net recently. However there is an error regarding to my openwithparam() statement, each time I run the following code this exception occurred:
{System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Windows.Markup.XamlParseException: 'Initialization of 'AxMSCommLib.AxMSComm' threw an exception.' Line number '40' and line position '14'. ---> System.Runtime.InteropServices.COMException: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid) at System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
at System.Windows.Forms.AxHost.CreateInstance()
at System.Windows.Forms.AxHost.GetOcxCreate()
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
at System.Windows.Forms.AxHost.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.AxHost.EndInit()
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin)
--- End of inner exception stack trace ---
at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
at System.Windows.Application.LoadComponent(Uri resourceLocator)
at Sybase.PowerBuilder.WPF.PBWindow..ctor()
at c__w_platgi..ctor() in c:\Users\User\Desktop\Phase32.0\offshore.out\offshore5_w_platgi_w.cs:line 0
--- End of inner exception stack trace ---
at Sybase.PowerBuilder.PBSessionBase.CreateInstance[T](PBPowerObject parent, Type type, Boolean init, T& t)
at Sybase.PowerBuilder.PBWindowCreater.CreateWindow[T](Type type, Boolean init, T& t, PBPowerObject p)
at Sybase.PowerBuilder.PBWindowCreater.CreateWindow[T](Boolean& newWindow, IPBWindow w, Type type, Boolean init, T& t, PBPowerObject p)
at Sybase.PowerBuilder.PBWindowCreater.CreateWindow[T](Boolean& newWindow, IPBWindow w, Type type, T& t)
at Sybase.PowerBuilder.WPF.PBSystemFunctions.Open[T0](T0& w)
at c__gf_winopen.gf_winopen(PBString as_module, PBString as_inspcode, PBAny as_parm) in c:\Users\User\Desktop\Phase32.0\offshore.out\gf_winopen(QSSA):line 26
at c__w_tree.c__dw_strinsplist.doubleclicked(PBInt xpos, PBInt ypos, PBLong row, PBDWObject dwo) in c:\Users\User\Desktop\Phase32.0\offshore.out\w_tree.dw_strinsplist.doubleclicked:line 52
| at Sybase.PowerBuilder.WPF.PBDataWindow.a(Object A_0, DWClickedEventArgs A_1)} | System.Exception {System.Reflection.TargetInvocationException} |
Please help me, I am stuck for days.
Request clarification before answering.
'AxMSCommLib.AxMSComm' .. seems to be related to an ActiveX control.
Does the application run without issues in PB12.5 Classic?
Have you allready applied all PowerBuilder Updates etc.?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The more useful information you provide, the more useful the responses. What type of target did you migrate your classic client/server application code to? Different targets support different features. WinForms only partially support in-process ole controls - and there are additional system requirements (e.g., Microsoft ActiveX Control Importer - aximp.exe) . Presumably you are encountering the error on your development pc and not one on which you have deployed your application - but it would be good to confirm that.
The target is a WPF windows application, I have tried to run on 4 PC and the exception keeps coming up on all the pc. When in the classic application we have used MSComm32 ocx and when we migrate the application to .net the powerbuilder have generated mscommlib as a reference. I hope this info helps.
Open up a command window on the development machine and type "aximp" and hit return. If you don't get a response from the "Microsoft .Net ActiveX Control to Windows Form Assembly Generator", then you don't have the SDK configured correctly. That utility is used during the Classic to WPF migration to support ActiveX controls. PB generates a WinForm control wrapper for the ActiveX and then hosts that in WindowsFormsHost control. That would actually tend to throw a different error, but it's worth verifying.
What the error would indicate that it can't find the ActiveX. Are you sure it's installed on the machine(s) that you're trying to run the application on?
Finally, what you might also want to consider is simply replacing the functionality that the ActiveX control provided with the equivalent in .Net code.
Check to see if aximp is located on the development machine. It should be located in a Program Files\Microsoft SDKs\Windows\v7.1\bin directory or similar. This is only needed on the development machine, and only for the initial migration.
Did you see the second question on the installation of the ActiveX? Are the machines where the code is failing development machines or end-user machines?
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.