Re: How to I call D code from C# Project?

2014-06-25 Thread FrankLike via Digitalmars-d-learn

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.


Re: How to I call D code from C# Project?

2014-06-25 Thread Binarydepth via Digitalmars-d-learn

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.


Re: How to I call D code from C# Project?

2014-06-19 Thread Andre Artus via Digitalmars-d-learn

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



Re: How to I call D code from C# Project?

2014-06-19 Thread Kagamin via Digitalmars-d-learn

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?


Re: How to I call D code from C# Project?

2014-06-19 Thread SomeRiz via Digitalmars-d-learn
I know it but I can not do without the drag-and-drop. (Design 
etc..)


Re: How to I call D code from C# Project?

2014-06-18 Thread Jesse Phillips via Digitalmars-d-learn

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)


Re: How to I call D code from C# Project?

2014-06-18 Thread GoD via Digitalmars-d-learn

@Jesse

How to use in C# projects?


Re: How to I call D code from C# Project?

2014-06-18 Thread Jesse Phillips via Digitalmars-d-learn

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.