Ms Visual C Sharp
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Ms Visual C Sharp
Kajot,
C sharp uses .NET and neither Harbour/xHarbour support it yet.
Anyhow, there is a way to use .NET from them
I take the opportunity to announce that we are working on a new FiveNet product that allows to use .NET libraries from Harbour/xHarbour
C sharp uses .NET and neither Harbour/xHarbour support it yet.
Anyhow, there is a way to use .NET from them
I take the opportunity to announce that we are working on a new FiveNet product that allows to use .NET libraries from Harbour/xHarbour
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Ms Visual C Sharp
I'm not so surprised. I know since many years that you are a real genius.
EMG
EMG
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Ms Visual C Sharp
Dear Enrico,
Its just a matter of work and some luck
Its just a matter of work and some luck
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Ms Visual C Sharp
Yes, plus a big head like you.Antonio Linares wrote:Dear Enrico,
Its just a matter of work and some luck
EMG
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Re: Ms Visual C Sharp
Antonio
I have tried to stay away from .net but I welcome your efforts .. I know I get a lot of flack from the Visual Studio crowd because they are considered ( mainstream ) .net programmers be it in either C#, or Visual Basic.
I dislike run-times .. but it looks like the .net train is gathering a lot of motion. Please look at both the .net ADO connectivity as well as the .net controls in your research.
I will follow this thread with much interest !!
Rick Lipkin
I have tried to stay away from .net but I welcome your efforts .. I know I get a lot of flack from the Visual Studio crowd because they are considered ( mainstream ) .net programmers be it in either C#, or Visual Basic.
I dislike run-times .. but it looks like the .net train is gathering a lot of motion. Please look at both the .net ADO connectivity as well as the .net controls in your research.
I will follow this thread with much interest !!
Rick Lipkin
Re: Ms Visual C Sharp
Dear Antonio,
I want to know whether .Net Framework is needed for using .NET libraries.
Regards,
sajith
Wish u all success in ur effort.I take the opportunity to announce that we are working on a new FiveNet product that allows to use .NET libraries from Harbour/xHarbour
I want to know whether .Net Framework is needed for using .NET libraries.
Regards,
sajith
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Ms Visual C Sharp
Sajith,
> I want to know whether .Net Framework is needed for using .NET libraries.
yes, of course
.NET has to be installed on the computer where you want to use your app
> I want to know whether .Net Framework is needed for using .NET libraries.
yes, of course
.NET has to be installed on the computer where you want to use your app
- MarcoBoschi
- Posts: 925
- Joined: Thu Nov 17, 2005 11:08 am
- Location: Padova - Italy
- Contact:
Re: Ms Visual C Sharp
Antonio,
do you think that a program like this may translated into xharbour/Fivewin?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using INNOVAPHONE.test.Cs.pbx_wsdl;
namespace INNOVAPHONE.test.Cs
{
//
// this form will merely show a window with cumulating PBX events
// its purpose is to demonstrate the use of async events in VB.Net
//
public partial class FrmMain : Form
{
// the forms PBX link
myPBX pbx;
// PBX access data
// assuming the controling user is "_TAPI_" which has a user-password "access"
const string httpUser = "admin";
const string httpPw = "ip800";
const string pbxUser = "_TAPI_";
const string pbxMonitor = "Marco Boschi";
const string pbxUrl = "http://172.28.2.240/PBX0/user.soap";
// PBX runtime data
public int pbxKey;
public int pbxSession;
public int pbxUserId;
public FrmMain()
{
InitializeComponent();
}
// initalize pbx link on load
private void FrmMain_Load(object sender, System.EventArgs e)
{
FrmMain frm = (FrmMain)sender;
try
{
// create the link
pbx = new myPBX(ref frm, addEvent, showEchoResult, callStarted);
// set the URL
pbx.Url = pbxUrl;
// set the HTTP level credentials
pbx.Credentials = new System.Net.NetworkCredential(httpUser, httpPw, "");
// initialize the session, remember the session-id and -key
pbxSession = pbx.Initialize(pbxUser, "VBNet SOAP Test", true, true, out pbxKey);
// monitor a user
pbxUserId = pbx.UserInitialize(pbxSession, pbxMonitor, false);
// start async retrieval of events from pbx
pbx.startPolling();
}
catch (Exception err)
{
string msg1;
string msg2;
msg1 = err.Message;
if (err.InnerException != null)
{
msg2 = err.InnerException.Message;
}
else
{
msg2 = "";
}
MessageBox.Show("pbx link initialization failed: " + msg1 + " / " + msg2);
}
}
public void addEvent(string ev)
{
events.Items.Add(ev);
}
private void btnEcho_Click(object sender, EventArgs e)
{
try
{
FrmMain main = this;
myPBX _m = new myPBX(ref main, addEvent, showEchoResult, callStarted);
// set the URL
_m.Url = pbxUrl;
// set the HTTP level credentials
_m.Credentials = new System.Net.NetworkCredential(httpUser, httpPw, "");
// initialize the session, remember the session-id and -key
int _mKey;
int _mSession = _m.Initialize(pbxUser, "VBNet SOAP Test", true, true, out _mKey);
// monitor a user
//int _mUserId = _m.UserInitialize(pbxSession, pbxMonitor, false);
_m.startEcho(pbxSession, pbxKey);
}
catch (Exception ex)
{
MessageBox.Show("Eccezione in esecuzione richiesta.");
}
}
public void showEchoResult(string res)
{
MessageBox.Show(res);
}
public void callStarted(string res)
{
MessageBox.Show(res);
}
private void btnCall_Click(object sender, EventArgs e)
{
try
{
pbx.createCall();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
// the PBX link
// we need a derived class to be able to handle the async events
public class myPBX : pbx_wsdl.pbx
{
// derive from the auto-generated soap class
// link to form
private FrmMain form;
public delegate void AddEventDelegate(string ev);
private AddEventDelegate _addEventDelegate;
public delegate void ShowEchoResultDelegate(string res);
private ShowEchoResultDelegate _showEchoResultDelegate;
public delegate void CallStartedDelegate(string res);
private CallStartedDelegate _callStartedDelegate;
// constructor to save the form link
public myPBX(ref FrmMain form, AddEventDelegate eventD, ShowEchoResultDelegate echoD, CallStartedDelegate callD)
{
//preparo i metodi esterni per la gestione asincrona dei risultati dei vari metodi
_addEventDelegate = eventD;
_showEchoResultDelegate = echoD;
_callStartedDelegate = callD;
//prendo il form per poter invocare il metodo corretto
this.form = form;
//collego i miei metodi di gestione dei risultati a quelli del webService
this.PollCompleted += new pbx_wsdl.PollCompletedEventHandler(pollCB);
this.EchoCompleted += new pbx_wsdl.EchoCompletedEventHandler(echoCB);
this.UserCallCompleted += new pbx_wsdl.UserCallCompletedEventHandler(userCallCB);
}
// setup an async Poll
public void startPolling()
{
try
{
this.PollAsync(form.pbxSession);
}
catch (Exception e)
{
MessageBox.Show("start poll failed: " + e.Message + " / " + e.InnerException.ToString());
}
}
// setup an async call request
public void createCall()
{
try
{
int key;
int session_h = this.Initialize("Marco Boschi", "demo", true, true, out key);
int user_h = this.UserInitialize(session_h, "Marco Boschi", true);
this.UserCallAsync(user_h, "", "267", "", 0, null);
}
catch (Exception e)
{
MessageBox.Show("start call failed: " + e.Message + " / " + e.InnerException.ToString());
}
}
//setup an async Exho (Nicola 14/11/2008
public void startEcho(int _session, int _key)
{
try
{
this.EchoAsync(_session, _key);
}
catch (Exception ex)
{
MessageBox.Show("start echo failed: " + ex.Message + " / " + ex.InnerException.ToString());
}
}
// handle an async Poll result
private void pollCB(object sender, pbx_wsdl.PollCompletedEventArgs e)
{
// scan user and call events
foreach (pbx_wsdl.UserInfo ui in e.Result.user)
{
string description = "user ";
if (!String.IsNullOrEmpty(ui.cn))
{
description = description + "(" + ui.type + ") " + ui.cn;
}
// Me.form.events.Items.Add("user " + ui.cn) -- dangerous
this.form.Invoke(_addEventDelegate, new object[] { description });
}
foreach (pbx_wsdl.CallInfo ci in e.Result.call)
{
// Me.form.events.Items.Add("call -> " + ci.msg) -- dangerous
this.form.Invoke(_addEventDelegate, new object[] { "call -> " + ci.msg });
}
// schedule next async Poll
this.startPolling();
}
//handle an async Echo result
private void echoCB(object sender, pbx_wsdl.EchoCompletedEventArgs e)
{
this.form.Invoke(_showEchoResultDelegate, new object[] { String.Concat("il controllo di sessione ha risposto: ", e.Result) });
}
//handle an async userCall result
private void userCallCB(object sender, pbx_wsdl.UserCallCompletedEventArgs e)
{
string error = "";
if (e.Error != null)
{
error = e.Error.Message;
}
string message = String.Format("Creazione cancellata ({0}). Errore: {1}.\r\nRisultato: {2}.\r\nUserState: {3}.", e.Cancelled, error, e.Result, e.UserState.ToString());
this.form.Invoke(_callStartedDelegate, new object[] { message });
}
}
}
do you think that a program like this may translated into xharbour/Fivewin?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using INNOVAPHONE.test.Cs.pbx_wsdl;
namespace INNOVAPHONE.test.Cs
{
//
// this form will merely show a window with cumulating PBX events
// its purpose is to demonstrate the use of async events in VB.Net
//
public partial class FrmMain : Form
{
// the forms PBX link
myPBX pbx;
// PBX access data
// assuming the controling user is "_TAPI_" which has a user-password "access"
const string httpUser = "admin";
const string httpPw = "ip800";
const string pbxUser = "_TAPI_";
const string pbxMonitor = "Marco Boschi";
const string pbxUrl = "http://172.28.2.240/PBX0/user.soap";
// PBX runtime data
public int pbxKey;
public int pbxSession;
public int pbxUserId;
public FrmMain()
{
InitializeComponent();
}
// initalize pbx link on load
private void FrmMain_Load(object sender, System.EventArgs e)
{
FrmMain frm = (FrmMain)sender;
try
{
// create the link
pbx = new myPBX(ref frm, addEvent, showEchoResult, callStarted);
// set the URL
pbx.Url = pbxUrl;
// set the HTTP level credentials
pbx.Credentials = new System.Net.NetworkCredential(httpUser, httpPw, "");
// initialize the session, remember the session-id and -key
pbxSession = pbx.Initialize(pbxUser, "VBNet SOAP Test", true, true, out pbxKey);
// monitor a user
pbxUserId = pbx.UserInitialize(pbxSession, pbxMonitor, false);
// start async retrieval of events from pbx
pbx.startPolling();
}
catch (Exception err)
{
string msg1;
string msg2;
msg1 = err.Message;
if (err.InnerException != null)
{
msg2 = err.InnerException.Message;
}
else
{
msg2 = "";
}
MessageBox.Show("pbx link initialization failed: " + msg1 + " / " + msg2);
}
}
public void addEvent(string ev)
{
events.Items.Add(ev);
}
private void btnEcho_Click(object sender, EventArgs e)
{
try
{
FrmMain main = this;
myPBX _m = new myPBX(ref main, addEvent, showEchoResult, callStarted);
// set the URL
_m.Url = pbxUrl;
// set the HTTP level credentials
_m.Credentials = new System.Net.NetworkCredential(httpUser, httpPw, "");
// initialize the session, remember the session-id and -key
int _mKey;
int _mSession = _m.Initialize(pbxUser, "VBNet SOAP Test", true, true, out _mKey);
// monitor a user
//int _mUserId = _m.UserInitialize(pbxSession, pbxMonitor, false);
_m.startEcho(pbxSession, pbxKey);
}
catch (Exception ex)
{
MessageBox.Show("Eccezione in esecuzione richiesta.");
}
}
public void showEchoResult(string res)
{
MessageBox.Show(res);
}
public void callStarted(string res)
{
MessageBox.Show(res);
}
private void btnCall_Click(object sender, EventArgs e)
{
try
{
pbx.createCall();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
// the PBX link
// we need a derived class to be able to handle the async events
public class myPBX : pbx_wsdl.pbx
{
// derive from the auto-generated soap class
// link to form
private FrmMain form;
public delegate void AddEventDelegate(string ev);
private AddEventDelegate _addEventDelegate;
public delegate void ShowEchoResultDelegate(string res);
private ShowEchoResultDelegate _showEchoResultDelegate;
public delegate void CallStartedDelegate(string res);
private CallStartedDelegate _callStartedDelegate;
// constructor to save the form link
public myPBX(ref FrmMain form, AddEventDelegate eventD, ShowEchoResultDelegate echoD, CallStartedDelegate callD)
{
//preparo i metodi esterni per la gestione asincrona dei risultati dei vari metodi
_addEventDelegate = eventD;
_showEchoResultDelegate = echoD;
_callStartedDelegate = callD;
//prendo il form per poter invocare il metodo corretto
this.form = form;
//collego i miei metodi di gestione dei risultati a quelli del webService
this.PollCompleted += new pbx_wsdl.PollCompletedEventHandler(pollCB);
this.EchoCompleted += new pbx_wsdl.EchoCompletedEventHandler(echoCB);
this.UserCallCompleted += new pbx_wsdl.UserCallCompletedEventHandler(userCallCB);
}
// setup an async Poll
public void startPolling()
{
try
{
this.PollAsync(form.pbxSession);
}
catch (Exception e)
{
MessageBox.Show("start poll failed: " + e.Message + " / " + e.InnerException.ToString());
}
}
// setup an async call request
public void createCall()
{
try
{
int key;
int session_h = this.Initialize("Marco Boschi", "demo", true, true, out key);
int user_h = this.UserInitialize(session_h, "Marco Boschi", true);
this.UserCallAsync(user_h, "", "267", "", 0, null);
}
catch (Exception e)
{
MessageBox.Show("start call failed: " + e.Message + " / " + e.InnerException.ToString());
}
}
//setup an async Exho (Nicola 14/11/2008
public void startEcho(int _session, int _key)
{
try
{
this.EchoAsync(_session, _key);
}
catch (Exception ex)
{
MessageBox.Show("start echo failed: " + ex.Message + " / " + ex.InnerException.ToString());
}
}
// handle an async Poll result
private void pollCB(object sender, pbx_wsdl.PollCompletedEventArgs e)
{
// scan user and call events
foreach (pbx_wsdl.UserInfo ui in e.Result.user)
{
string description = "user ";
if (!String.IsNullOrEmpty(ui.cn))
{
description = description + "(" + ui.type + ") " + ui.cn;
}
// Me.form.events.Items.Add("user " + ui.cn) -- dangerous
this.form.Invoke(_addEventDelegate, new object[] { description });
}
foreach (pbx_wsdl.CallInfo ci in e.Result.call)
{
// Me.form.events.Items.Add("call -> " + ci.msg) -- dangerous
this.form.Invoke(_addEventDelegate, new object[] { "call -> " + ci.msg });
}
// schedule next async Poll
this.startPolling();
}
//handle an async Echo result
private void echoCB(object sender, pbx_wsdl.EchoCompletedEventArgs e)
{
this.form.Invoke(_showEchoResultDelegate, new object[] { String.Concat("il controllo di sessione ha risposto: ", e.Result) });
}
//handle an async userCall result
private void userCallCB(object sender, pbx_wsdl.UserCallCompletedEventArgs e)
{
string error = "";
if (e.Error != null)
{
error = e.Error.Message;
}
string message = String.Format("Creazione cancellata ({0}). Errore: {1}.\r\nRisultato: {2}.\r\nUserState: {3}.", e.Cancelled, error, e.Result, e.UserState.ToString());
this.form.Invoke(_callStartedDelegate, new object[] { message });
}
}
}
Marco Boschi
info@marcoboschi.it
info@marcoboschi.it
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Ms Visual C Sharp
Marco,
Its almost impossible to translate it, but this FWH example may help you to do what you want (unless I did not properly understand what you want to do):
http://forums.fivetechsupport.com/viewt ... 257#p63257
GetPostData() source code is here:
http://forums.fivetechsupport.com/viewt ... 199#p63199
Its almost impossible to translate it, but this FWH example may help you to do what you want (unless I did not properly understand what you want to do):
http://forums.fivetechsupport.com/viewt ... 257#p63257
GetPostData() source code is here:
http://forums.fivetechsupport.com/viewt ... 199#p63199