OLE interop issue

i73

Member
Joined
Sep 27, 2016
Messages
5
Programming Experience
3-5
Alright, stay with me here, I have a few things I need to explain.

I'm trying OLE in C# currently for Photoshop CS6, late binding works perfectly by creating an instance of the application:


C#:
[COLOR=#333333][FONT=adobe-clean][FONT='inherit']   dynamic app = Activator.CreateInstance(Type.GetTypeFromProgID("Photoshop.Application", true));[/FONT][/FONT][/COLOR]
[COLOR=#333333][FONT=adobe-clean][FONT=calibri]         var doc = app.Open("D:\\a.psd");[/FONT][/FONT][/COLOR]

Though I would like access to the Photoshop Assembly library; So I am trying to use the Photoshop COM Assembly, when I do I get an error (No interface supported):

C#:
[COLOR=#333333][FONT=adobe-clean][FONT='inherit']   Photoshop.ApplicationClass app = new Photoshop.ApplicationClass();[/FONT][/FONT][/COLOR]
[COLOR=#333333][FONT=adobe-clean][FONT='inherit']   var doc = app.Open("My Image Path);
[/FONT][/FONT][/COLOR]


Screenshot_84.png

Looking into it a little further people say I need to register 'TypeLibrary.tlb' manually but when I do:

Screenshot_85.png
I want to know before I go installing VS 2010:
Apparently, regtlibv12.exe is part of Visual Studio 2010 (contrary to what I read on various Microsoft forums), but it is located in the Windows\Microsoft.NET\Framework\v4.0.30139 folder (not the v2.0.50727 folder). Using that executable I was able to successfully register the legacy typelib (.tlb).


If anyone could give me any suggestions on how to access this library without getting this interface error (I have not had too much experience with this, so is it just getting the wrong application address?) or if I am registering TypeLib wrong, I would appreciate it!








 

Attachments

  • Screenshot_86.png
    Screenshot_86.png
    3.6 KB · Views: 66
Back
Top Bottom