943,614 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 2553
  • C# RSS
Sep 23rd, 2009
0

Problem when opening Photoshop in C#

Expand Post »
Hi, everyone!

I am using Interop.Photoshop.Dll from my C# Windows Forms application. I am using a com object that Adobe Photoshop CS4 provides to use Photoshop in my C# program.

I'm using the ApplicationClass class to launch Photoshop. I have Photosoft CS3 and CS4 on my machine. When I do this:

C# Syntax (Toggle Plain Text)
  1. Photoshop.ApplicationClass app = new Photoshop.ApplicationClass()

It launches Photoshop CS3 and does not launch CS4. Is there someone who knows the cause of this?

P.S: I checked my registry at // HKEY_CLASSES_ROOT\Photoshop.AdobePlugin\shell\open\command and it points to the Photoshop CS4 executable.
Similar Threads
Reputation Points: 72
Solved Threads: 26
Posting Whiz in Training
GDICommander is offline Offline
209 posts
since Jun 2008
Sep 24th, 2009
0

Re: Problem when opening Photoshop in C#

Why don't you call Process.Start() instead of using their interop for opening it? If all you're doing is executing it then just start the process.
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Sep 24th, 2009
0

Re: Problem when opening Photoshop in C#

Unfortunately, I can't call Process.Start() because I will need to get the opened images in Photoshop in my code. So, I need a "pointer" on the application and ApplicationClass can provide it to me.
Reputation Points: 72
Solved Threads: 26
Posting Whiz in Training
GDICommander is offline Offline
209 posts
since Jun 2008
Sep 24th, 2009
0

Re: Problem when opening Photoshop in C#

Zip all of the assemblies Photoshop ships (the interop and related assemblies) so I can take a look at them. This might be a %PATH% issues for installed versions
Last edited by sknake; Sep 24th, 2009 at 8:21 am.
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009
Sep 24th, 2009
0

Re: Problem when opening Photoshop in C#

Unfortunately, I cannot send you the assemblies because of the security policies of where I work.

I tried to add the directory path of the Photoshop CS4 executable to the %PATH% variable (because it wasn't here), but it didn't work.

Maybe I will try to uninstall CS3 and see if the ApplicationClass constructor launches CS4, but it is not an acceptable workaround for the user of my program. Any other ideas?
Reputation Points: 72
Solved Threads: 26
Posting Whiz in Training
GDICommander is offline Offline
209 posts
since Jun 2008
Sep 24th, 2009
0

Re: Problem when opening Photoshop in C#

I was going to decompile the assembly and look how it was determining which application to launch, and how you could change it. I guess you could do that yourself.

Reflector:
http://www.red-gate.com/products/reflector/
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: format decimal value to time
Next Thread in C# Forum Timeline: Instant Messenger





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC