>
> I did just have a coworker send me working code using PyCall:

...


Thanks - based on that, it is a COM IDispatch interface.


> Does that just add an extra layer of overhead?


Yes. Whether it is significant enough to worry about depends on your code.

I did read that PyCall is basically a wrapper around ccall.
>

Think of it more as embedding Python in Julia, like one could embed Python
in C or any other language in order to execute functions and share data
between the C program and Python via the CPython API. It does use ccall to
make calls into libpython, but the actual functionality you are interested
in is implemented in Python.

"how do I 'spell' SomeDLL.SomeCLASS, in Julia?"

I hope this is enough info, or that I can "backtrace" what the PyCall is
> doing.


In the snippet you sent, you are utilizing the win32com library, which
knows how to enumerate and call an IDispatch COM interface. Julia doesn't
have a way to do this as-yet.

You would need to do (approximately) the steps outlined in the tutorial
series linked from this SO answer:

http://stackoverflow.com/questions/946114/how-to-use-idispatch-in-plain-c-to-call-a-com-object

I actually did start putting some together some infrastructure for this
last year, but didn't get to the dispatching yet (I mostly stopped using
Windows for a number of months, until recently). It might save some time if
someone wants to run with it:

https://github.com/ihnorton/COMCall.jl

On Wed, May 6, 2015 at 9:00 AM, <[email protected]> wrote:

> I appreciate your response, and your willingness to help. As if I weren't
> confused enough already, I am confused by your confusion :)
>
> I did just have a coworker send me working code using PyCall:
>
> @pyimport win32com.client as w32
> engine = w32.Dispatch("TestDLL.DSS")
> engine[:Start]("0")
>
> Does that just add an extra layer of overhead? We are going to be calling
> that in a loop with large data sets so efficiency is important (realize the
> size of the dataset is not a factor here, but it means the program is going
> to run a long time already and I wan to avoid making it any longer).
>
> I do not have source for the DLL. In Excel, I viewed the object browser,
> selected references, browsed to the DLL and clicked on it.
>
> I am surprised, though, not to find an index for "Start" in dumpbin -- nor
> for "DSS". I do think I read somewhere that the DLL was written in Delphi,
> but I am not sure of that right now.
>
> It's been a few years since I last wrote any "real program", but I am
> pulling out C# try to get *something* working.
>
> ----------
> Dump of file TestDLL.dll
>
> File Type: DLL
>
>   Summary
>
>         D000 .bss
>        64000 .data
>         1000 .didata
>         1000 .edata
>         6000 .idata
>        33000 .pdata
>        23000 .reloc
>        61000 .rsrc
>       4EB000 .text
> ----------
>
> So, though I know a lot of stuff goes on in the background, it appears as
> if everything needed to use this DLL comes inside the DLL -- neither PyCall
> nor VBA requested any additional information. VBA then presents Classes in
> the left pane, Members in the right, and I call the function thus (looks a
> lot like PyCall):
>
> Set TestObj = New TestDLL.DSS
> TestObj.Start(0)
>
> Therefore, I took this to be a Julia syntax question: "how do I 'spell'
> SomeDLL.SomeCLASS, in Julia?"
>
> I hope this is enough info, or that I can "backtrace" what the PyCall is
> doing. I did read that PyCall is basically a wrapper around ccall. I am
> very new to Julia (in case you can't tell), I think this will all come
> together for me very quickly once I find the cornerstone.
>
> Thank you!!
>
>
>
> -------------------------------------------------------
> On Tuesday, May 5, 2015 at 5:00:15 PM UTC-5, Isaiah wrote:
>>
>> We really need more information to be able to help here. How is the
>> function exported? It might be simplest for you to post the source for
>> TestDLL, if possible, or barring that, the signature of Start from
>> Dependency Walker (or Dumpbin).
>>
>> ccall doesn't know anything about COM or C++. The former is somewhat
>> tractable, the latter minimally so, especially if the DLL uses MSVC ABI.
>>
>> (in principle it should be possible to do full COM introspection and
>> binding for dynamic COM interfaces in pure Julia, but I don't know of
>> anyone who has tried to do so yet)
>>
>> In case it helps, I have some more examples of how to call Win32
>> functions, here:
>> https://github.com/ihnorton/Win32GUIDemo.jl
>>
>>

Reply via email to