| Thread overview | ||||||
|---|---|---|---|---|---|---|
|
March 26, 2016 Calling .NET from D | ||||
|---|---|---|---|---|
| ||||
Found a simple way to call .NET managed code from un-managed D code. I didn't know about it so I thought someone else could find it useful. https://github.com/taylorh140/Calling-NET-from-D | ||||
March 26, 2016 Re: Calling .NET from D | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Taylor Hillegeist | On Saturday, 26 March 2016 at 07:53:06 UTC, Taylor Hillegeist wrote: > Found a simple way to call .NET managed code from un-managed D code. I didn't know about it so I thought someone else could find it useful. > > https://github.com/taylorh140/Calling-NET-from-D Thank you so much for this. This is very helpful indeed. I guess you might have looked also into going the other way around - calling D code from C#. Anything one should know beyond the standard pinvoke/C API described here? https://msdn.microsoft.com/en-us/library/aa288468(v=vs.71).aspx | |||
March 26, 2016 Re: Calling .NET from D | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Laeeth Isharc | On Saturday, 26 March 2016 at 14:15:18 UTC, Laeeth Isharc wrote:
> On Saturday, 26 March 2016 at 07:53:06 UTC, Taylor Hillegeist wrote:
>> Found a simple way to call .NET managed code from un-managed D code. I didn't know about it so I thought someone else could find it useful.
>>
>> https://github.com/taylorh140/Calling-NET-from-D
>
> Thank you so much for this. This is very helpful indeed.
>
> I guess you might have looked also into going the other way around - calling D code from C#.
>
> Anything one should know beyond the standard pinvoke/C API described here?
>
> https://msdn.microsoft.com/en-us/library/aa288468(v=vs.71).aspx
That looks pretty good.
It seems to me as if microsoft wants managed to unmanaged calls,as opposed to unmanaged to managed, the link to pinvoke/C is probably more information than the total I gathered for reverse p-invoke (DllExport). If you need more information on any of the processes involved feel free to make it an issue for repo.
| |||
March 26, 2016 Re: Calling .NET from D | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Taylor Hillegeist | I used this[1] code for interfacing between C# and D once. It[2] demonstrates how to use a function callback passed from C# code. C# use winapi calling convention by default which caused me hours of headache untill I figured it out. Fortunately, there is an attribute to specify it. [1] https://github.com/NightmareX1337/IDL/wiki [2] https://github.com/NightmareX1337/IDL/blob/master/IDL/IDL.d | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply