Re: PsDotNet - Photoshop C# library
Posted: Fri Dec 22, 2017 2:23 pm
Hi davidwright ,
Nice to meet you here!
I'm use your PsDotNet.dll everything OK with my application but have only one problem with my when call function .Close().
This function working ok with Photoshop CS6... but throw a exception with CC2017, CC2018.
My application need to close all documents and layers after processed done! So, this function is very important for performance!
Your can help check this exception below? Thanks you so much and this library is awesome when interact to Photoshop
************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.
- The object "document 0" is not currently available.
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Photoshop.Document.get_id()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
at PsDotNet.Base.Extensions.GetHashCodeOrId(Document document)
at PsDotNet.Base.PsDocument.GetHashCode()
at PsDotNet.Base.Collections.PsDocuments.get_NeedsRefresh()
at PsDotNet.Base.PsApplication.get_Documents()
at PsDotNet.Base.PsApplication.Open(String filePath, Boolean asSmartObject, Object asType)
//----
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Nice to meet you here!
I'm use your PsDotNet.dll everything OK with my application but have only one problem with my when call function .Close().
This function working ok with Photoshop CS6... but throw a exception with CC2017, CC2018.
My application need to close all documents and layers after processed done! So, this function is very important for performance!
Your can help check this exception below? Thanks you so much and this library is awesome when interact to Photoshop
************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: General Photoshop error occurred. This functionality may not be available in this version of Photoshop.
- The object "document 0" is not currently available.
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at Photoshop.Document.get_id()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
at PsDotNet.Base.Extensions.GetHashCodeOrId(Document document)
at PsDotNet.Base.PsDocument.GetHashCode()
at PsDotNet.Base.Collections.PsDocuments.get_NeedsRefresh()
at PsDotNet.Base.PsApplication.get_Documents()
at PsDotNet.Base.PsApplication.Open(String filePath, Boolean asSmartObject, Object asType)
//----
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)