But, Is it really working with harbour ?
The test of Ricardo didn't work until now "
┌────────────────────────────────────────────────────────────────────────────┐
?FiveWin for Harbour 19.09 (MSVC++) Sep. 2019 Harbour development power │▄
?(c) FiveTech 1993-2019 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 │█
└────────────────────────────────────────────────────────────────────────────┘?
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀?
Compiling...
Harbour 3.2.0dev (r1711221033)
Copyright (c) 1999-2016, http://harbour-project.org/
Compiling 'dotnet.prg' and generating preprocessed output to 'dotnet.ppo'...
Lines 4947, Functions/Procedures 1
Generating C source output to 'dotnet.c'... Done.
Microsoft (R) C/C++ Optimizing Compiler versione 19.16.27034 per x86
Copyright (C) Microsoft Corporation. Tutti i diritti sono riservati.
dotnet.c
FiveH32.lib(DOTNET_.obj) : error LNK2001: simbolo esterno _HB_FUN_CLSID_CLRMETAHOST non risolto
FiveH32.lib(DOTNET_.obj) : error LNK2001: simbolo esterno _HB_FUN_IID_ICLRMETAHOST non risolto
FiveH32.lib(DOTNET_.obj) : error LNK2001: simbolo esterno _HB_FUN_CLRMETAHOSTGETRUNTIME non risolto
FiveH32.lib(DOTNET_.obj) : error LNK2001: simbolo esterno _HB_FUN_CLRRUNTIMEINFOGETINTERFACE non risolto
FiveH32.lib(DOTNET_.obj) : error LNK2001: simbolo esterno _HB_FUN_CLRRUNTIMEHOSTSTART non risolto
FiveH32.lib(DOTNET_.obj) : error LNK2001: simbolo esterno _HB_FUN_CLRRUNTIMEHOSTEXECUTE non risolto
dotnet.exe : fatal error LNK1120: 6 esterni non risolti
* Linking errors *
vilian wrote:But, Is it really working with harbour ?
The test of Ricardo didn't work until now "
using System.Windows.Forms;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Runtime.InteropServices;
using System.Data;
using System.Data.OleDb;
namespace conexion
{
public class myGrid
{
public static int connectar( string a )
{
MessageBox.Show( a );
string connetionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\fwh\\fwhteam\\samples\\xbrtest.mdb;";
string sql = "SELECT * FROM Customer";
MessageBox.Show( "String of connection and command sql" );
OleDbConnection connection = new OleDbConnection(connetionString);
MessageBox.Show( "Connection OK" );
OleDbCommand command = new OleDbCommand(sql, connection);
connection.Open();
MessageBox.Show( "Open connection" );
OleDbDataAdapter da = new OleDbDataAdapter(command);
DataSet ds = new DataSet();
da.Fill( ds, "Customers_table");
MessageBox.Show( "Customer" );
MessageBox.Show( ds.Tables[0].Rows[0]["First"].ToString() );
connection.Close();
return 0;
}
}
}
rem call "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
csc /out:datagrid.dll /target:library datagrid0.cs
#include "FiveWin.ch"
Static cDll := "datagrid.dll"
Static cWorkSpace := "conexion.myGrid"
Static cMethod := "connectar"
//----------------------------------------------------------------------------//
function Main()
local oNet
oNet := TDotNet():New()
oNet:Execute( cDll, cWorkSpace, cMethod, "Conectar" )
//? oNet:GetResult(), oNet:GetReturnValue(), oNet:GetValueReturn()
? oNet:GetNetError()
oNet:End()
return nil
//----------------------------------------------------------------------------//
using System;
using System.Collections;
using System.Drawing;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace MyForm.AX
{
[ProgId("MyForm.AX.Form1")]
[ClassInterface(ClassInterfaceType.AutoDual)]
public partial class Form1x : System.Windows.Forms.UserControl
{
public Form1x()
{
InitializeComponent();
}
#region field definitions
...
#region get-set Com-Controls
public string text1
{
get { return this.textBox1.Text; }
set { this.textBox1.Text = value; }
}
public string text2
{
get { return this.textBox2.Text; }
set { this.textBox2.Text = value; }
}
public string text3
{
get { return this.textBox3.Text; }
set { this.textBox3.Text = value; }
}
public string text4
{
get { return this.textBox4.Text; }
set { this.textBox4.Text = value; }
}
public string text5
{
get { return this.textBox5.Text; }
set { this.textBox5.Text = value; }
}
public bool check1
{
get { return this.checkBox1.Checked; }
set { this.checkBox1.Checked = value; }
}
public string combo1
{
get { return this.comboBox1.Text; }
set { this.comboBox1.Text = value; }
}
public string addItemCombo1
{
set { this.comboBox1.Items.Add(value);}
}
#endregion
...
AntoninoP wrote:hello,
I tryed the dotnet sample, what I get is:
- Code: Select all Expand view
┌────────────────────────────────────────────────────────────────────────────┐
?FiveWin for Harbour 19.09 (MSVC++) Sep. 2019 Harbour development power │▄
?(c) FiveTech 1993-2019 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 │█
└────────────────────────────────────────────────────────────────────────────┘?
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀?
Compiling...
Harbour 3.2.0dev (r1711221033)
Copyright (c) 1999-2016, http://harbour-project.org/
Compiling 'dotnet.prg' and generating preprocessed output to 'dotnet.ppo'...
Lines 4947, Functions/Procedures 1
Generating C source output to 'dotnet.c'... Done.
Microsoft (R) C/C++ Optimizing Compiler versione 19.16.27034 per x86
Copyright (C) Microsoft Corporation. Tutti i diritti sono riservati.
dotnet.c
FiveH32.lib(DOTNET_.obj) : error LNK2001: simbolo esterno _HB_FUN_CLSID_CLRMETAHOST non risolto
FiveH32.lib(DOTNET_.obj) : error LNK2001: simbolo esterno _HB_FUN_IID_ICLRMETAHOST non risolto
FiveH32.lib(DOTNET_.obj) : error LNK2001: simbolo esterno _HB_FUN_CLRMETAHOSTGETRUNTIME non risolto
FiveH32.lib(DOTNET_.obj) : error LNK2001: simbolo esterno _HB_FUN_CLRRUNTIMEINFOGETINTERFACE non risolto
FiveH32.lib(DOTNET_.obj) : error LNK2001: simbolo esterno _HB_FUN_CLRRUNTIMEHOSTSTART non risolto
FiveH32.lib(DOTNET_.obj) : error LNK2001: simbolo esterno _HB_FUN_CLRRUNTIMEHOSTEXECUTE non risolto
dotnet.exe : fatal error LNK1120: 6 esterni non risolti
* Linking errors *
cnavarro wrote:Not published. Is in libs of Fwh
#define WIN32_LEAN_AND_MEAN // Escludere gli elementi usati raramente dalle intestazioni di Windows
// File di intestazione di Windows
#include <windows.h>
#include <objbase.h>
#include <hbapi.h>
#include <hbapierr.h>
#include <hbapiitm.h>
#include <hbinit.h>
#include <hbstack.h>
#include <hbvmpub.h>
using namespace System;
using namespace System::Reflection;
using namespace System::Runtime::InteropServices;
using namespace System::IO;
// convert a .NET string to a C by using the Harbor memory manager
static char* FromString(String^ src);
// spawns a harbor error starting from a .NET one
static void HandleError(Exception^ e);
HB_FUNC(SHOWDIALOG) {
try { //I did not check if the calls are successful, everything is taken from the catch and brought to harbor.
CoInitializeEx(0, COINIT_APARTMENTTHREADED);
// get the absolute path to the dll
String^ dllPath = Path::GetFullPath(gcnew String(hb_parc(1)));
// load it
Assembly^ pDll = Assembly::LoadFile(dllPath);
//Console::WriteLine(pDll ? "dll loaded" : "dll not loaded");
// get the type
String ^typeName = gcnew String(hb_parc(2));
Type^ objType = pDll->GetType(typeName);
//Console::WriteLine(objType ? "type found" : "type not found");
// instance it
//Console::WriteLine(System::Threading::Thread::CurrentThread->ApartmentState);
Object^ tmp = pDll->CreateInstance(typeName);
//Console::WriteLine(tmp? "object created" : "object not object");
// get the method
MethodInfo^ showDlg = objType->GetMethod("ShowDialog");
//Console::WriteLine(showDlg ? "method found" : "method not found");
// call it
array<Object^>^ params = nullptr;
//if (showDlg->GetParameters()->Length > 0) { TODO
// array<ParameterInfo^>^ pInfo = showDlg->GetParameters();
// int n = hb_pcount()-2;
// for (int i = 0; i < n; i++) {
//
// }
//}
showDlg->Invoke(tmp, params);
//Console::WriteLine("method called");
}
catch (Exception^ e) {
// if all goes well it does not arrive here
HandleError(e);
}
hb_ret();
}
static char* FromString(String^ src) {
Text::Encoding^ ascii = Text::Encoding::ASCII;
cli::array<unsigned char>^ bytes = ascii->GetBytes(src);
char* dest = (char*)hb_xgrab(bytes->Length);
Marshal::Copy(bytes, 0, IntPtr(dest), bytes->Length);
return dest;
}
static void HandleError(Exception^ e) {
if (e->InnerException)
e = e->InnerException;
PHB_ITEM pError = hb_errRT_New(ES_ERROR, "Net2HB", e->HResult, 0,
FromString(e->Message),FromString(e->Source), 0, EF_NONE);
if (hb_pcount() != 0) {
/* HB_ERR_ARGS_BASEPARAMS */
PHB_ITEM pArray = hb_arrayBaseParams();
hb_errPutArgsArray(pError, pArray);
hb_itemRelease(pArray);
}
hb_errPutFileName(e, FromString(e->StackTrace));
hb_errLaunch(pError);
hb_errRelease(pError);
}
#pragma unmanaged
// HB_FS_FIRST solo alla prima :)
HB_INIT_SYMBOLS_BEGIN(hb_vm_SymbolInit_Net2HB)
{ "SHOWDIALOG", { HB_FS_PUBLIC | HB_FS_FIRST | HB_FS_LOCAL }, { HB_FUNCNAME(SHOWDIALOG) }, NULL }
};
static PHB_SYMB symbols;
//HB_INIT_SYMBOLS_END(hb_vm_SymbolInit_Net2HB)
BOOL WINAPI DllMain(
HINSTANCE hinstDLL, // handle to DLL module
DWORD fdwReason, // reason for calling function
LPVOID lpReserved) // reserved
{
// Perform actions based on the reason for calling.
switch (fdwReason)
{
case DLL_PROCESS_ATTACH:
// in CLR static initialization does not work
symbols = hb_vmProcessSymbols(symbols_table, (HB_USHORT)HB_INIT_SYMBOLS_COUNT, "", 0L, 0x0000);
break;
// case DLL_THREAD_ATTACH: // Do thread-specific initialization.
// break;
// case DLL_THREAD_DETACH: // Do thread-specific cleanup.
// break;
// case DLL_PROCESS_DETACH: // Perform any necessary cleanup.
// break;
}
return TRUE; // Successful DLL_PROCESS_ATTACH.
}
/Yu"stdafx.h" /GS /W3 /Zc:wchar_t /I"c:\harbour\include" /Zi /Od /Fd"x64\Debug\vc142.pdb" /Zc:inline /fp:precise /D "HB_DYNLIB" /D "_DEBUG" /D "_WINDLL" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /clr /FU"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\mscorlib.dll" /FU"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.dll" /FU"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll" /FU"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.dll" /MDd /FC /Fa"x64\Debug\" /EHa /nologo /Fo"x64\Debug\" /Fp"x64\Debug\DotNetCaller.pch" /diagnostics:column
/OUT:"C:\TL\TLPosWin\DotNetCaller\x64\Debug\DotNetCaller.dll" /MANIFEST /NXCOMPAT /PDB:"C:\TL\TLPosWin\DotNetCaller\x64\Debug\DotNetCaller.pdb" /DYNAMICBASE "hbmainstd.lib" "hbmainwin.lib" "hbcplr.lib" "harbour-32.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /FIXED:NO /DEBUG:FULL /DLL /MACHINE:X64 /INCREMENTAL /PGD:"C:\TL\TLPosWin\DotNetCaller\x64\Debug\DotNetCaller.pgd" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ManifestFile:"x64\Debug\DotNetCaller.dll.intermediate.manifest" /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"C:\Harbour64\lib\win\msvc64" /ASSEMBLYDEBUG /TLBID:1
cnavarro wrote:Not published. Is in libs of Fwh
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³ FiveWin for Harbour 20.06 (VS32bits) Jun. 2020 Harbour development power ³Ü
³ (c) FiveTech 1993-2020 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 ³Û
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.7.3
** Copyright (c) 2020 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'
Compiling...
Harbour 3.2.0dev (r1904111533)
Copyright (c) 1999-2019, https://harbour.github.io/
Compiling 'dotnet2.prg' and generating preprocessed output to 'dotnet2.ppo'...
Lines 4957, Functions/Procedures 1
Generating C source output to 'dotnet2.c'... Done.
dotnet2.c
FiveH32.lib(DOTNET_.obj) : error LNK2001: ‡”zmlenmemiŸ dŸ sembol _HB_FUN_CLSID_CLRMETAHOST
FiveH32.lib(DOTNET_.obj) : error LNK2001: ‡”zmlenmemiŸ dŸ sembol _HB_FUN_IID_ICLRMETAHOST
FiveH32.lib(DOTNET_.obj) : error LNK2001: ‡”zmlenmemiŸ dŸ sembol _HB_FUN_CLRMETAHOSTGETRUNTIME
FiveH32.lib(DOTNET_.obj) : error LNK2001: ‡”zmlenmemiŸ dŸ sembol _HB_FUN_CLRRUNTIMEINFOGETINTERFACE
FiveH32.lib(DOTNET_.obj) : error LNK2001: ‡”zmlenmemiŸ dŸ sembol _HB_FUN_CLRRUNTIMEHOSTSTART
FiveH32.lib(DOTNET_.obj) : error LNK2001: ‡”zmlenmemiŸ dŸ sembol _HB_FUN_CLRRUNTIMEHOSTEXECUTE
dotnet2.exe : fatal error LNK1120: 6 ‡”zmlenmemiŸ dŸlar
* Linking errors *
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 74 guests