Thread overview | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
|
June 18, 2014 How to I call D code from C# Project? | ||||
---|---|---|---|---|
| ||||
Hi. I want use my D code in C# How can I do this? D, very fast programming language. But I can not WinForm applications from D. I'm using C# for WinForm applications. But, also i want to use D code for my project. for example; I'm see PC information with D lang. Example Code(Suppose that D): PCInformation //D LANG CODE { showHDDSerialNumber(); showCPUsage(); showMACAdress(); showFooBar(); } Example Code(Suppose that C#): using namespace DCODE; // DCODE Library written it D Lang WinFormApp { PCInformation pin = new PCInformation(); // D code import Label1.Text = pin.ShowHDDSerialNumber(); // D code import } How can I do this? Sorry for my bad english :( Thank you :) |
June 18, 2014 Re: How to I call D code from C# Project? | ||||
---|---|---|---|---|
| ||||
Posted in reply to GoD | On Wednesday, 18 June 2014 at 20:55:09 UTC, GoD wrote: > Hi. > > I want use my D code in C# > > How can I do this? My plan was to use COM. I've not actually implemented such communication. Juno provides some items: https://github.com/JesseKPhillips/Juno-Windows-Class-Library/ But I haven't done a update for latest compiler and as I said, haven't created a real project with it. (Got annoyed with MS security in an example I was working on) |
June 18, 2014 Re: How to I call D code from C# Project? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jesse Phillips | @Jesse How to use in C# projects? |
June 19, 2014 Re: How to I call D code from C# Project? | ||||
---|---|---|---|---|
| ||||
Posted in reply to GoD | On Wednesday, 18 June 2014 at 23:41:43 UTC, GoD wrote: > @Jesse > > How to use in C# projects? You'll have to access it through a COM interface on the C# side. http://msdn.microsoft.com/en-us/library/aa645736%28v=vs.71%29.aspx If you haven't done work in COM before its a lot of new things to learn. C# should also have interfacing with C, so you can have D expose a C interface. Sorry I can't walk you through working examples. As mentioned, I haven't gotten that far myself. |
June 19, 2014 Re: How to I call D code from C# Project? | ||||
---|---|---|---|---|
| ||||
Posted in reply to GoD | On Wednesday, 18 June 2014 at 20:55:09 UTC, GoD wrote: > Hi. > > I want use my D code in C# > > How can I do this? > > D, very fast programming language. But I can not WinForm applications from D. I'm using C# for WinForm applications. But, also i want to use D code for my project. > > for example; > > I'm see PC information with D lang. > > Example Code(Suppose that D): > > PCInformation //D LANG CODE > { > showHDDSerialNumber(); > showCPUsage(); > showMACAdress(); > showFooBar(); > > } > > Example Code(Suppose that C#): > > using namespace DCODE; // DCODE Library written it D Lang > > WinFormApp > { > PCInformation pin = new PCInformation(); // D code import > Label1.Text = pin.ShowHDDSerialNumber(); // D code import > } > > How can I do this? > > Sorry for my bad english :( > > Thank you :) You could write a DLL un D, and call that from C# with PInvoke. http://wiki.dlang.org/Win32_DLLs_in_D http://msdn.microsoft.com/en-us/library/aa288468(v=vs.71).aspx |
June 19, 2014 Re: How to I call D code from C# Project? | ||||
---|---|---|---|---|
| ||||
Posted in reply to GoD | On Wednesday, 18 June 2014 at 20:55:09 UTC, GoD wrote:
> D, very fast programming language. But I can not WinForm applications from D. I'm using C# for WinForm applications.
DWT and TkD didn't work for you?
|
June 19, 2014 Re: How to I call D code from C# Project? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kagamin | I know it but I can not do without the drag-and-drop. (Design etc..) |
June 25, 2014 Re: How to I call D code from C# Project? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kagamin | On Thursday, 19 June 2014 at 13:59:25 UTC, Kagamin wrote:
> On Wednesday, 18 June 2014 at 20:55:09 UTC, GoD wrote:
>> D, very fast programming language. But I can not WinForm applications from D. I'm using C# for WinForm applications.
>
> DWT and TkD didn't work for you?
Can you give us some Design tools on windows for DWT?
Thank you.
|
June 25, 2014 Re: How to I call D code from C# Project? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jesse Phillips | On Thursday, 19 June 2014 at 04:07:30 UTC, Jesse Phillips wrote:
> On Wednesday, 18 June 2014 at 23:41:43 UTC, GoD wrote:
>> @Jesse
>>
>> How to use in C# projects?
>
> You'll have to access it through a COM interface on the C# side.
>
> http://msdn.microsoft.com/en-us/library/aa645736%28v=vs.71%29.aspx
>
> If you haven't done work in COM before its a lot of new things to learn.
>
> C# should also have interfacing with C, so you can have D expose a C interface.
>
> Sorry I can't walk you through working examples. As mentioned, I haven't gotten that far myself.
That sounds legit.
|
Copyright © 1999-2021 by the D Language Foundation