Re: Accessing COM Objects

2017-03-10 Thread Inquie via Digitalmars-d-learn
On Friday, 17 June 2016 at 08:09:42 UTC, John wrote: On Wednesday, 15 June 2016 at 21:06:01 UTC, Joerg Joergonson wrote: My thinking is that CoCreateinstance is suppose to give us a pointer to the interface so we can use it, if all this stuff is crashing does that mean the interface is invalid

Re: Accessing COM Objects

2017-03-10 Thread Inquie via Digitalmars-d-learn
On Friday, 17 June 2016 at 08:09:42 UTC, John wrote: On Wednesday, 15 June 2016 at 21:06:01 UTC, Joerg Joergonson wrote: [...] The problem is Photoshop hasn't provided an interface with methods that can be called directly. They don't exist on the interface, hence them being commented out.

Re: Accessing COM Objects

2016-06-17 Thread John via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 21:06:01 UTC, Joerg Joergonson wrote: My thinking is that CoCreateinstance is suppose to give us a pointer to the interface so we can use it, if all this stuff is crashing does that mean the interface is invalid or not being assigned properly or is there far more

Re: Accessing COM Objects

2016-06-16 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 21:06:01 UTC, Joerg Joergonson wrote: Ok, I've tried things like uncommenting Document Open(BSTR Document, VARIANT As, VARIANT AsSmartObject); void Load(BSTR Document); /*[id(0x70537673)]*/ BSTR get_ScriptingVersion(); /*[id(0x70464D4D)]*/

Re: Accessing COM Objects

2016-06-15 Thread Joerg Joergonson via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 19:21:51 UTC, John wrote: On Wednesday, 15 June 2016 at 18:32:28 UTC, Joerg Joergonson wrote: import core.sys.windows.com, core.sys.windows.oaidl; Thanks. Should these not be added to the generated file? The problem is that other type libraries will probably

Re: Accessing COM Objects

2016-06-15 Thread John via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 18:35:42 UTC, Joerg Joergonson wrote: On Wednesday, 15 June 2016 at 06:09:33 UTC, thedeemon wrote: On Monday, 13 June 2016 at 17:38:41 UTC, Incognito wrote: [...] There are ready tools idl2d: https://github.com/dlang/visuald/tree/master/c2d [...] I can't

Re: Accessing COM Objects

2016-06-15 Thread John via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 18:32:28 UTC, Joerg Joergonson wrote: import core.sys.windows.com, core.sys.windows.oaidl; Thanks. Should these not be added to the generated file? The problem is that other type libraries will probably require other headers to be imported, and there's no way

Re: Accessing COM Objects

2016-06-15 Thread Joerg Joergonson via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 06:09:33 UTC, thedeemon wrote: On Monday, 13 June 2016 at 17:38:41 UTC, Incognito wrote: [...] There are ready tools idl2d: https://github.com/dlang/visuald/tree/master/c2d [...] I can't seem to get ComPtr to work. auto ps =

Re: Accessing COM Objects

2016-06-15 Thread Joerg Joergonson via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 17:20:31 UTC, John wrote: On Wednesday, 15 June 2016 at 16:45:39 UTC, Joerg Joergonson wrote: Thanks. When I ran it I got a d file! when I tried to use that d file I get undefined IID and IDispatch. I imagine these interfaces come from somewhere, probably built

Re: Accessing COM Objects

2016-06-15 Thread John via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 16:45:39 UTC, Joerg Joergonson wrote: Thanks. When I ran it I got a d file! when I tried to use that d file I get undefined IID and IDispatch. I imagine these interfaces come from somewhere, probably built in? Any ideas? Add the following after the module name:

Re: Accessing COM Objects

2016-06-15 Thread Joerg Joergonson via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 15:12:06 UTC, thedeemon wrote: On Wednesday, 15 June 2016 at 07:01:30 UTC, Joerg Joergonson wrote: It seems idl2d from VD is not easily compilable? I don't remember problems with that, anyway here's the binary I used: http://stuff.thedeemon.com/idl2d.exe

Re: Accessing COM Objects

2016-06-15 Thread Joerg Joergonson via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 08:24:41 UTC, John wrote: On Wednesday, 15 June 2016 at 08:21:06 UTC, John wrote: OK, adding the return type to the signature should fix that. So: private static Parameter getParameters(MethodImpl method) Sorry, I meant the getParameter methods should return

Re: Accessing COM Objects

2016-06-15 Thread Joerg Joergonson via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 16:03:04 UTC, Jesse Phillips wrote: On Monday, 13 June 2016 at 01:22:33 UTC, Incognito wrote: [...] There is also: https://github.com/JesseKPhillips/Juno-Windows-Class-Library It kind of provides similar highlevel options as the "Modern COM Programming in D."

Re: Accessing COM Objects

2016-06-15 Thread Jesse Phillips via Digitalmars-d-learn
On Monday, 13 June 2016 at 01:22:33 UTC, Incognito wrote: I've been reading over D's com and can't find anything useful. It seems there are different ways: http://www.lunesu.com/uploads/ModernCOMProgramminginD.pdf which is of no help and requires an idl file, which I don't have. Then

Re: Accessing COM Objects

2016-06-15 Thread thedeemon via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 07:01:30 UTC, Joerg Joergonson wrote: It seems idl2d from VD is not easily compilable? I don't remember problems with that, anyway here's the binary I used: http://stuff.thedeemon.com/idl2d.exe

Re: Accessing COM Objects

2016-06-15 Thread John via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 08:21:06 UTC, John wrote: OK, adding the return type to the signature should fix that. So: private static Parameter getParameters(MethodImpl method) Sorry, I meant the getParameter methods should return be: private static Parameter[] getParameters(MethodImpl

Re: Accessing COM Objects

2016-06-15 Thread John via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 06:56:59 UTC, Joerg Joergonson wrote: When I try to compile your code I get the following errors: main.d(953): Error: function core.sys.windows.objbase.CoTaskMemAlloc (uint) is not callable using argument types (immutable(ulong)) main.d(970): Error: can only

Re: Accessing COM Objects

2016-06-15 Thread Joerg Joergonson via Digitalmars-d-learn
On Wednesday, 15 June 2016 at 06:09:33 UTC, thedeemon wrote: On Monday, 13 June 2016 at 17:38:41 UTC, Incognito wrote: Cool. Oleview gives me the idl files. How to convert the idl files to d or possibly c? There are ready tools idl2d: https://github.com/dlang/visuald/tree/master/c2d and

Re: Accessing COM Objects P3

2016-06-15 Thread Joerg Joergonson via Digitalmars-d-learn
[in] long index, [out] long* value); [id(0x60020017)] HRESULT PutClass([in] long value); [id(0x60020018)] HRESULT GetGlobalClass( [in] long index, [out] long* value);

Re: Accessing COM Objects

2016-06-15 Thread thedeemon via Digitalmars-d-learn
On Monday, 13 June 2016 at 17:38:41 UTC, Incognito wrote: Cool. Oleview gives me the idl files. How to convert the idl files to d or possibly c? There are ready tools idl2d: https://github.com/dlang/visuald/tree/master/c2d and tlb2idl: https://github.com/dlang/visuald/tree/master/tools I've

Re: Accessing COM Objects

2016-06-14 Thread John via Digitalmars-d-learn
On Monday, 13 June 2016 at 19:26:08 UTC, Incognito wrote: On Monday, 13 June 2016 at 19:11:59 UTC, John wrote: On Monday, 13 June 2016 at 17:38:41 UTC, Incognito wrote: Cool. Oleview gives me the idl files. How to convert the idl files to d or possibly c? Would I just use them in place of

Re: Accessing COM Objects

2016-06-14 Thread Kagamin via Digitalmars-d-learn
Visual D has a tool to convert IDL files to D.

Re: Accessing COM Objects

2016-06-13 Thread Incognito via Digitalmars-d-learn
On Monday, 13 June 2016 at 19:11:59 UTC, John wrote: On Monday, 13 June 2016 at 17:38:41 UTC, Incognito wrote: Cool. Oleview gives me the idl files. How to convert the idl files to d or possibly c? Would I just use them in place of IUnknown once I have the interface? In OleView you can

Re: Accessing COM Objects

2016-06-13 Thread John via Digitalmars-d-learn
On Monday, 13 June 2016 at 17:38:41 UTC, Incognito wrote: Cool. Oleview gives me the idl files. How to convert the idl files to d or possibly c? Would I just use them in place of IUnknown once I have the interface? In OleView you can save the IDL file, then run another tool, midl.exe, on

Re: Accessing COM Objects

2016-06-13 Thread Incognito via Digitalmars-d-learn
On Monday, 13 June 2016 at 07:40:09 UTC, John wrote: On Monday, 13 June 2016 at 01:22:33 UTC, Incognito wrote: I've been reading over D's com and can't find anything useful. It seems there are different ways: http://www.lunesu.com/uploads/ModernCOMProgramminginD.pdf which is of no help and

Re: Accessing COM Objects

2016-06-13 Thread John via Digitalmars-d-learn
On Monday, 13 June 2016 at 01:22:33 UTC, Incognito wrote: I've been reading over D's com and can't find anything useful. It seems there are different ways: http://www.lunesu.com/uploads/ModernCOMProgramminginD.pdf which is of no help and requires an idl file, which I don't have. Then

Re: Accessing COM Objects

2016-06-12 Thread Mike Parker via Digitalmars-d-learn
On Monday, 13 June 2016 at 04:52:49 UTC, Mike Parker wrote: On Monday, 13 June 2016 at 02:08:22 UTC, Incognito wrote: What interface are you talking about? How can I cast to something I don't have? I do not have a photoshop COM interface. Are you saying that if CoCreateInstance worked that I

Re: Accessing COM Objects

2016-06-12 Thread Mike Parker via Digitalmars-d-learn
On Monday, 13 June 2016 at 02:08:22 UTC, Incognito wrote: What interface are you talking about? How can I cast to something I don't have? I do not have a photoshop COM interface. Are you saying that if CoCreateInstance worked that I can then use the iid or pUnk to access the COM? Do I get the

Re: Accessing COM Objects

2016-06-12 Thread Incognito via Digitalmars-d-learn
On Monday, 13 June 2016 at 01:52:12 UTC, Mike Parker wrote: On Monday, 13 June 2016 at 01:22:33 UTC, Incognito wrote: I can do this stuff in C# by simply dragging and dropping a dll into the references and it works fine but is a bit slow. I was hoping I could speed things up using D but it

Re: Accessing COM Objects

2016-06-12 Thread Mike Parker via Digitalmars-d-learn
On Monday, 13 June 2016 at 01:22:33 UTC, Incognito wrote: I can do this stuff in C# by simply dragging and dropping a dll into the references and it works fine but is a bit slow. I was hoping I could speed things up using D but it seems like COM isn't really supported, despite what several

Accessing COM Objects

2016-06-12 Thread Incognito via Digitalmars-d-learn
I've been reading over D's com and can't find anything useful. It seems there are different ways: http://www.lunesu.com/uploads/ModernCOMProgramminginD.pdf which is of no help and requires an idl file, which I don't have. Then theres this http://wiki.dlang.org/COM_Programming which is also