FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Using C# (and .NET) from FWH
Posts: 6
Joined: Wed Jun 05, 2019 02:24 PM
Re: Using C# (and .NET) from FWH
Posted: Mon Jun 17, 2019 12:06 PM
Hello!

It would be nice to use a .NET Dll with Fivewin and I tried the sample, but nothing happend, literally nothing. So I created my own Dll and changed the sample dotnet.prg to this:
Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

Β  Β local oNet

Β  Β oNet := TDotNet():New()
Β  Β  ? IIF(oNet != nil, "Net yes!", "Net no :(")
Β  Β  XBrowse(__objGetValueList(oNet))
Β  Β  
Β  Β  oNet:Execute("SimpleDllFramework.dll", "SimpleDllFramework.Class1", "GetNumber", 2)
Β  Β  ? oNet:GetNetError()
Β  Β  ? oNet:GetReturnValue()
Β  Β 
Β  Β oNet:End()
Β  Β 
return nil


Code (fw): Select all Collapse
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
?FiveWin for xHarbour 19.03 - Mar. 2019 Β  Β  Β  Β  Β xHarbour development power β”‚β–„
?(c) FiveTech 1993-2019 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 β”‚β–ˆ
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜?
Β  β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€β–€?
Compiling...
xHarbour 1.2.3 Intl. (SimpLex) (Build 20190603)
Copyright 1999-2018, http://www.xharbour.org <!-- m --><a class="postlink" href="http://www.harbour-project.org/">http://www.harbour-project.org/</a><!-- m -->
Compiling 'dotnet.prg' and generating preprocessed output to 'dotnet.ppo'...
Generating C source output to 'dotnet.c'...
Done.
Lines 27, Functions/Procedures 1, pCodes 69
Embarcadero C++ 7.30 for Win32 Copyright (c) 1993-2017 Embarcadero Technologies,
Β Inc.
dotnet.c:
Turbo Incremental Link 6.80 Copyright (c) 1997-2017 Embarcadero Technologies, In
c.
* Application successfully built *


The sample doesn't show me either the messages or the XBrowse.
What went wrong?
I appreciate every hint I could get here :-)
Thanks in advance.

The simplest Dll I could imagine :-)

Code (fw): Select all Collapse
namespace SimpleDllFramework
{
Β  Β  public class Class1
Β  Β  {
Β  Β  Β  public static int GetNumber(int input = 1)
Β  Β  Β  {
Β  Β  Β  Β  Β return input * 10;
Β  Β  Β  }
Β  Β }
}

Compiled with .NET Framework 4 (first with 4.6.1), Core 2.2 and Standard 2 but nothing worked.

Sincerely

Continue the discussion