l 函數原型:
int WINAPI icePub_dictionaryCodeTransfer(char *strDictionaryFilename,char *strSrc,char *strCode)
輸入:strDictionaryFilename 字典文件名
strSrc 待處理單詞
輸出:strCode strSrc對應信息
返回碼:
l VC連接Lib方式聲明
__declspec(dllexport)
int WINAPI icePub_dictionaryCodeTransfer(char *strDictionaryFilename,char *strSrc,char *strCode);
l 動態調用例程
VC sample代碼:
char strCode[1024];
typedef int (WINAPI ICEPUB_DICTIONARYCODETRANSFER)(char *strDictionaryFilename,char *strSrc,char *strCode);
ICEPUB_DICTIONARYCODETRANSFER *icePub_dictionaryCodeTransfer = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_dictionaryCodeTransfer = (ICEPUB_DICTIONARYCODETRANSFER *)GetProcAddress(hDLLDrv, "icePub_dictionaryCodeTransfer");
}
if(icePub_dictionaryCodeTransfer)
icePub_dictionaryCodeTransfer("漢英字典.txt","我",strCode);
if(hDLLDrv)
FreeLibrary(hDLLDrv);
AfxMessagBox(strCode);
VB sample 代碼:
Private Declare Function icePub_dictionaryCodeTransfer Lib "icePubDll.dll" (ByVal strDictionaryFilename As String,ByVal strSrc As String,ByVal strCode As String) As Integer
Dim a2 As Integer
Dim strCode As String
strCode=Space(1024)
a2=icePub_dictionaryCodeTransfer("漢英字典.txt","我",strCode)
MsgBox strCode
=============================
3.87 icePub_dictionaryCodeTransferString
批量轉換
l 函數原型:
int WINAPI icePub_dictionaryCodeTransferString(char *strDictionaryFilename,char *strSrcString,char *strCode,int srcWordLen,char *strFenge)
輸入:strDictionaryFilename 字典文件名
strSrcString 待處理單詞串
srcWordLen 待處理單詞串裏每壹個單詞長度(意思必須是定長)
strFenge strCode裏每壹個結果分隔字符串
輸出:strCode strSrcString對應信息串
返回碼:
l VC連接Lib方式聲明
__declspec(dllexport)
int WINAPI icePub_dictionaryCodeTransferString(char *strDictionaryFilename,char *strSrcString,char *strCode,int srcWordLen,char *strFenge);
l 動態調用例程
VC sample代碼:
char strCode[1024];
typedef int (WINAPI ICEPUB_DICTIONARYCODETRANSFERSTRING)(char *strDictionaryFilename,char *strSrcString,char *strCode,int srcWordLen,char *strFenge);
ICEPUB_DICTIONARYCODETRANSFERSTRING *icePub_dictionaryCodeTransferString = 0;
HINSTANCE hDLLDrv = LoadLibrary("icePubDll.dll");
if(hDLLDrv)
{
icePub_dictionaryCodeTransferString = (ICEPUB_DICTIONARYCODETRANSFERSTRING *)GetProcAddress(hDLLDrv, "icePub_dictionaryCodeTransferString");
}
if(icePub_dictionaryCodeTransferString)
icePub_dictionaryCodeTransferString("內碼字典.txt","憂飔蕭然",2,strCode," ");
if(hDLLDrv)
FreeLibrary(hDLLDrv);
AfxMessagBox(strCode);
VB sample 代碼:
Private Declare Function icePub_dictionaryCodeTransferString Lib "icePubDll.dll" (ByVal strDictionaryFilename As String,ByVal strSrcString As String,ByVal srcWordLen As Integer,ByVal strCode As String,ByVal strFenge As String) As Integer
Dim a2 As Integer
Dim strCode As String
strCode=Space(1024)
a2=icePub_dictionaryCodeTransferString("內碼字典.txt","愁雲慘淡",2,strCode, " ")
MsgBox strCode
===========
收郵件吧