Using C# (and .NET) from FWH

User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Using C# (and .NET) from FWH

Post by Antonio Linares »

We have done a major advance on using C# (or any other .NET based language) from FWH :-)

This is going to be part of FWH 18.05

For now, please start testing this:

1. How to build a C# DLL:

test.cs

Code: Select all

using System.Windows.Forms;

namespace dllNamespace
{
    public class dllClass
    {
        public static int ShowMsg( string msg )
        {
            MessageBox.Show( msg );
            return 0;
        }
   }
}
To build it as a DLL do this:
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
csc /out:test.dll /target:library test.cs

Next: I will explain you how to run it from FWH 18.05 ;-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
MFarias
Posts: 39
Joined: Wed Jun 25, 2014 11:16 am
Location: João Pessoa,PB - Brazil

Re: Using C# (and .NET) from FWH

Post by MFarias »

Show, thats fantastic !!!!! \o/
FW 17.09 - xHB 1.2.3 - Embarcadero C++ 7
xDevStudio 0.72 - FivEdit ( \o/ ) - Pelles C
MySQL 5.7 - DBF
FastReport - PHP for Web Services - Java Android
http://matheusfariasdev.wordpress.com
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: Using C# (and .NET) from FWH

Post by TimStone »

Antonio,

As you advance with this, perhaps you can keep in mind how we might turn a FWH program into a service. We've discussed this before, but never came to the point of an actual working service that can run in the background. We got builds, but it would not actually run. Maybe with this new technology we can actually accomplish that goal.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Using C# (and .NET) from FWH

Post by Antonio Linares »

This is already working :-)

dotnet.prg

Code: Select all

#include "FiveWin.ch"

function Main()

   FW_DotNet( "test.dll", "dllNamespace.dllClass", "ShowMsg", "C# from FWH" )

   FW_DotNet( "test.dll", "dllNamespace.dllClass", "ShowMsg", "yes!!!" )

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Using C# (and .NET) from FWH

Post by Antonio Linares »

.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Using C# (and .NET) from FWH

Post by Antonio Linares »

.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Adolfo
Posts: 815
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile
Contact:

Re: Using C# (and .NET) from FWH

Post by Adolfo »

Nice...
I will follow this topic, since I drop some developments because I couldn't access some .NET dll's and Libs

Greetins
From Chile
Adolfo
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Lenovo Legion Y520, 16GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1050
toninhofwi
Posts: 161
Joined: Tue Oct 18, 2005 10:01 am

Re: Using C# (and .NET) from FWH

Post by toninhofwi »

fantastic job, a big door is open now !

thank you.
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: Using C# (and .NET) from FWH

Post by vilian »

It's really great!
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Using C# (and .NET) from FWH

Post by Antonio Linares »

We are building a CLASS TDotNet ;-)

To be included in FWH 18.05
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Marc Venken
Posts: 727
Joined: Tue Jun 14, 2016 7:51 am

Re: Using C# (and .NET) from FWH

Post by Marc Venken »

Aha, Closer to my arduino then :wink:
Marc Venken
Using: FWH 20.08 with Harbour
User avatar
vilian
Posts: 795
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: Using C# (and .NET) from FWH

Post by vilian »

Antônio,
Is it not ready yet ?
I thought would be included in FWH 18.05 :(
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Using C# (and .NET) from FWH

Post by Antonio Linares »

Vilian,

Class TDotNet is already included in FWH 18.05 :-)

Please go to FWH\samples and do:

buildh.bat dotnet
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
miragerr
Posts: 140
Joined: Tue Oct 11, 2005 2:36 am
Location: Brasil

Re: Using C# (and .NET) from FWH

Post by miragerr »

Hello, friends

is it possible to use the FAST-REPORT.NET in this case?

I'm hanging on
Jackson Douglas C. Brito
Boa Vista - RR - Brasil
FWH 12.09 Last Build
xHarbour Free
UESTUDIO
SQLRDD
User avatar
cnavarro
Posts: 5792
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Using C# (and .NET) from FWH

Post by cnavarro »

miragerr wrote:Hello, friends

is it possible to use the FAST-REPORT.NET in this case?

I'm hanging on
Please
Send me or put a sample of how you are using the DLL now
C. Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
Si alguien te dice que algo no se puede hacer, recuerda que esta hablando de sus limitaciones, no de las tuyas.
Post Reply