How to combine (or use) SDK dll into Fivewin HB/XHB?
Posted: Thu Jul 02, 2015 2:49 am
Hello every experts!
I have limited experience with Fivewin.
I am trying to build-up telephone CID(Caller Identification) program with SDK published by phone company.
How Can I use this dll in FWH harbour/xHarbour?
Pleae help me...!
Attached my target DLL(KTOpenAPI.dll) as followings.
http://pharmalink.kr/images/K.zip
They mentioned to register their DLL ( KTOpenAPI.dll) as followings.
-----------------------------------------------------------------------------------
regsvr32 KTOpenAPI.dll
And and in MSC Sharp sample were as followings
Main.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace KTOpenAPICSharpSample
{
static class Program
{
/// <summary>
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new OpenAPI());
}
}
}
-------------------------------------------------------------------------
Form.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.InteropServices;
using KTPCBizLib;
namespace KTOpenAPICSharpSample
{
public partial class OpenAPI : Form
{
protected bool bLogin = false;
protected bool bAlreayLogined = false;
protected string strCONCaller = "";
protected bool bCONCalling = false;
public OpenAPI()
{
InitializeComponent();
textAuthKey.Text = "AuthKey Please";
textUserID.Text = "ID Input";
textUserPW.Text = "Password Input";
textServerType.Text = "0";
textCalleeNumber.Text = "";
comboMemoType.Items.Add("Private Memo");
comboMemoType.Items.Add("Common Memo");
comboMemoType.SelectedIndex = 1;
comboGrouptype.Items.Add("Private Group");
comboGrouptype.Items.Add("Common Group");
comboGrouptype.SelectedIndex = 1;
comboCallType.Items.Add("All");
comboCallType.Items.Add("Send");
comboCallType.Items.Add("Receive");
comboCallType.Items.Add("Absent");
comboCallType.Items.Add("Fail");
comboCallType.Items.Add("Reserve");
comboCallType.Items.Add("Mobile");
comboCallType.SelectedIndex = 0;
comboSmsType.Items.Add("All");
comboSmsType.Items.Add("Send");
comboSmsType.Items.Add("Receive");
comboSmsType.Items.Add("Absent");
comboSmsType.Items.Add("Fail");
comboSmsType.Items.Add("Reserve");
comboSmsType.Items.Add("Mobile");
comboSmsType.SelectedIndex = 0;
comboAdBirthdaytype.Items.Add("Lunar");
comboAdBirthdaytype.Items.Add("Calendar");
comboAdBirthdaytype.SelectedIndex = 1;
comboAdType.Items.Add("Private User");
comboAdType.Items.Add("Common User");
comboAdType.SelectedIndex = 1;
cbState.SelectedIndex = 0;
}
/// <summary>
/// Login
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnLogin_Click(object sender, EventArgs e)
{
if (textAuthKey.TextLength == 0 ||
textUserID.TextLength == 0 ||
textUserPW.TextLength == 0 ||
textServerType.TextLength == 0 )
{
MessageBox.Show("Lack of Login Data!!");
return;
}
int nLoginResult = axKTPCBizX1.Login(Convert.ToInt32(textServerType.Text),
textAuthKey.Text,
textUserID.Text,
textUserPW.Text);
switch (nLoginResult)
{
case 200 :
textConnectState.Text = "Connected!";
break;
case 301 :
textConnectState.Text = "Double Login at another PC";
bAlreayLogined = true;
break;
case 0 :
default :
textConnectState.Text = "Failure";
break;
}
}
I have limited experience with Fivewin.
I am trying to build-up telephone CID(Caller Identification) program with SDK published by phone company.
How Can I use this dll in FWH harbour/xHarbour?
Pleae help me...!
Attached my target DLL(KTOpenAPI.dll) as followings.
http://pharmalink.kr/images/K.zip
They mentioned to register their DLL ( KTOpenAPI.dll) as followings.
-----------------------------------------------------------------------------------
regsvr32 KTOpenAPI.dll
And and in MSC Sharp sample were as followings
Main.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace KTOpenAPICSharpSample
{
static class Program
{
/// <summary>
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new OpenAPI());
}
}
}
-------------------------------------------------------------------------
Form.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.InteropServices;
using KTPCBizLib;
namespace KTOpenAPICSharpSample
{
public partial class OpenAPI : Form
{
protected bool bLogin = false;
protected bool bAlreayLogined = false;
protected string strCONCaller = "";
protected bool bCONCalling = false;
public OpenAPI()
{
InitializeComponent();
textAuthKey.Text = "AuthKey Please";
textUserID.Text = "ID Input";
textUserPW.Text = "Password Input";
textServerType.Text = "0";
textCalleeNumber.Text = "";
comboMemoType.Items.Add("Private Memo");
comboMemoType.Items.Add("Common Memo");
comboMemoType.SelectedIndex = 1;
comboGrouptype.Items.Add("Private Group");
comboGrouptype.Items.Add("Common Group");
comboGrouptype.SelectedIndex = 1;
comboCallType.Items.Add("All");
comboCallType.Items.Add("Send");
comboCallType.Items.Add("Receive");
comboCallType.Items.Add("Absent");
comboCallType.Items.Add("Fail");
comboCallType.Items.Add("Reserve");
comboCallType.Items.Add("Mobile");
comboCallType.SelectedIndex = 0;
comboSmsType.Items.Add("All");
comboSmsType.Items.Add("Send");
comboSmsType.Items.Add("Receive");
comboSmsType.Items.Add("Absent");
comboSmsType.Items.Add("Fail");
comboSmsType.Items.Add("Reserve");
comboSmsType.Items.Add("Mobile");
comboSmsType.SelectedIndex = 0;
comboAdBirthdaytype.Items.Add("Lunar");
comboAdBirthdaytype.Items.Add("Calendar");
comboAdBirthdaytype.SelectedIndex = 1;
comboAdType.Items.Add("Private User");
comboAdType.Items.Add("Common User");
comboAdType.SelectedIndex = 1;
cbState.SelectedIndex = 0;
}
/// <summary>
/// Login
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void btnLogin_Click(object sender, EventArgs e)
{
if (textAuthKey.TextLength == 0 ||
textUserID.TextLength == 0 ||
textUserPW.TextLength == 0 ||
textServerType.TextLength == 0 )
{
MessageBox.Show("Lack of Login Data!!");
return;
}
int nLoginResult = axKTPCBizX1.Login(Convert.ToInt32(textServerType.Text),
textAuthKey.Text,
textUserID.Text,
textUserPW.Text);
switch (nLoginResult)
{
case 200 :
textConnectState.Text = "Connected!";
break;
case 301 :
textConnectState.Text = "Double Login at another PC";
bAlreayLogined = true;
break;
case 0 :
default :
textConnectState.Text = "Failure";
break;
}
}