Using .NET library
-
- Posts: 1163
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Using .NET library
Hi,
Is is possible to use a .NET library with FWH? Or is it better to create a seperate EXE-file compiled with the .NET library, and transfer the data with a text-file.
A want to use a .NET library file that generate drawings. My program give the correct data to create it.
Thanks
Is is possible to use a .NET library with FWH? Or is it better to create a seperate EXE-file compiled with the .NET library, and transfer the data with a text-file.
A want to use a .NET library file that generate drawings. My program give the correct data to create it.
Thanks
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: Using .NET library
Marc,
You may review FiveNet and the technique it uses to manage .NET from Harbour:
https://code.google.com/archive/p/fivenet/wikis/architecture.wiki
https://storage.googleapis.com/google-code-archive-source/v2/code.google.com/fivenet/source-archive.zip
You may review FiveNet and the technique it uses to manage .NET from Harbour:
https://code.google.com/archive/p/fivenet/wikis/architecture.wiki
https://storage.googleapis.com/google-code-archive-source/v2/code.google.com/fivenet/source-archive.zip
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: Using .NET library
I am migrating the project to bitbucket:
https://bitbucket.org/fivetech/fivenet
https://bitbucket.org/fivetech/fivenet/wiki/Home
https://bitbucket.org/fivetech/fivenet
https://bitbucket.org/fivetech/fivenet/wiki/Home
-
- Posts: 1163
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Re: Using .NET library
Antonio,
When I press the link https://bitbucket.org/fivetech/fivenet/wiki/Home
I get
You do not have access to the wiki.
Use the links at the top to get back.
When I press the link https://bitbucket.org/fivetech/fivenet/wiki/Home
I get
You do not have access to the wiki.
Use the links at the top to get back.
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: Using .NET library
Marc,
Please try it again, it should be ok now
FiveNet source code is very simple: We create a .NET DLL that we register and we manage from a Harbour application.
When we need some .NET value from the Harbour app, then we use a C DLL that access the code from the EXE.
Please try it again, it should be ok now
FiveNet source code is very simple: We create a .NET DLL that we register and we manage from a Harbour application.
When we need some .NET value from the Harbour app, then we use a C DLL that access the code from the EXE.
-
- Posts: 1163
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Re: Using .NET library
Antonio,
if I understand correctly, I need to create a .NET exe with my function to generate my drawings, and call a function from the harbour application.
if I understand correctly, I need to create a .NET exe with my function to generate my drawings, and call a function from the harbour application.
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: Using .NET library
Marc,
A .NET DLL, and then use the DLL from the Harbour app
In FiveNet makefile you can see how the DLL is created from a C sharp file:
Also, the DLL needs to be registered:
FiveNet\samples\register.bat
A .NET DLL, and then use the DLL from the Harbour app
In FiveNet makefile you can see how the DLL is created from a C sharp file:
Code: Select all | Expand
fivenet.dll : fivetech.cs
c:\Windows\Microsoft.NET\Framework\v3.5\csc /out:samples\fivenet.dll /target:library source\cs\fivetech.cs
c:\Windows\Microsoft.NET\Framework\v2.0.50727\regasm samples\fivenet.dll /tlb
Also, the DLL needs to be registered:
FiveNet\samples\register.bat
Code: Select all | Expand
c:\Windows\Microsoft.NET\Framework\v2.0.50727\regasm fivenet.dll /tlb
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: Using .NET library
Marc,
From FiveNet/source/prg/fivenet.prg this init procedure creates an OLE (.NET) object:
From FiveNet/source/prg/fivenet.prg this init procedure creates an OLE (.NET) object:
Code: Select all | Expand
init procedure FiveNet
local bError
if oFiveNet == nil
try
oFiveNet = win_oleCreateObject( "FiveTech.FiveNet" )
catch bError
wapi_MessageBox( 0, "Can't create object 'FiveTech.FiveNet'",;
"Please use register.bat", MB_ICONEXCLAMATION )
end
endif
return
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: Using .NET library
In other words:
Once the DLL is registered we can instantiate an OLE object to manage the DLL from the Harbour app
Once the DLL is registered we can instantiate an OLE object to manage the DLL from the Harbour app
-
- Posts: 1163
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Re: Using .NET library
Antonio,
If I run go.bat, I get :
So everything looks fine, except the 2 last lines. He can't find ftsnet.obj, and ftsnet.tlb.
Is that an error, or is this normal, because in the MAK-file, I see
If I run go.bat, I get :
- C:\_vmsdata\FWH\Fivenet>go
C:\_vmsdata\FWH\Fivenet>if not exist obj md obj
C:\_vmsdata\FWH\Fivenet>c:\_vmsdata\FWH\bcc55\bin\make -ffivenet.mak
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
c:\Windows\Microsoft.NET\Framework\v3.5\csc /out:samples\fivenet.dll /ta
rget:library source\cs\fivetech.cs
Microsoft (R) Visual C# 2008 Compiler versie 3.5.30729.5420
voor Microsoft (R) .NET Framework versie 3.5
Copyright (C) Microsoft Corporation. Alle rechten voorbehouden.
c:\Windows\Microsoft.NET\Framework\v2.0.50727\regasm samples\fivenet.dll
/tlb
Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.5483
Copyright (C) Microsoft Corporation 1998-2004. Alle rechten voorbehouden.
Typen zijn geregistreerd
Assembly is geëxporteerd naar C:\_vmsdata\FWH\Fivenet\samples\fivenet.tlb en de
typebibliotheek is geregistreerd
C:\_vmsdata\FWH\bcc55\bin\bcc32 -c source\c\ftsnet.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
source\c\ftsnet.c:
C:\_vmsdata\FWH\bcc55\bin\ilink32 /Tpd C:\_vmsdata\FWH\bcc55\lib\c0d32.o
bj ftsnet.obj, samples\ftsnet.dll,,C:\_vmsdata\FWH\bcc55\lib\cw32.lib C:\_vmsdat
a\FWH\bcc55\import32.lib
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Kan C:\_vmsdata\FWH\Fivenet\samples\ftsnet.obj niet vinden
Kan C:\_vmsdata\FWH\Fivenet\samples\ftsnet.tlb niet vinden
C:\_vmsdata\FWH\Fivenet>
So everything looks fine, except the 2 last lines. He can't find ftsnet.obj, and ftsnet.tlb.
Is that an error, or is this normal, because in the MAK-file, I see
- ftsnet.dll : ftsnet.c
$(BCDIR)\bin\bcc32 -c source\c\ftsnet.c
$(BCDIR)\bin\ilink32 /Tpd $(BCDIR)\lib\c0d32.obj ftsnet.obj, samples\ftsnet.dll,,$(BCDIR)\lib\cw32.lib $(BCDIR)\import32.lib
@del samples\ftsnet.i*
@del samples\ftsnet.map
@del samples\ftsnet.obj
@del samples\ftsnet.tds
@del samples\ftsnet.tlb
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
-
- Posts: 1163
- Joined: Mon Oct 17, 2005 5:41 am
- Location: Belgium
- Contact:
Re: Using .NET library
Before i have tried it with an old version of xharbour and got an error.
Now I tested it with Harbour and BCC7, and it's working!!!
Thanks
Now I tested it with Harbour and BCC7, and it's working!!!
Thanks
Regards,
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc
FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: Using .NET library
Antônio,
Do you know if is possible to integrate FWH with this https://www.signfiles.com/signature-library/ ?
Could you help us ?
Do you know if is possible to integrate FWH with this https://www.signfiles.com/signature-library/ ?
Could you help us ?
- Antonio Linares
- Site Admin
- Posts: 42597
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 40 times
- Been thanked: 86 times
- Contact:
Re: Using .NET library
Vilian,
Why don't you contact them for a C compatible DLL version ?
That may be much easier
Why don't you contact them for a C compatible DLL version ?
That may be much easier
