pFun->tpterm == NULL)
{
FreeLibrary(pFun->hLibfml32);
pFun->hLibfml32 = NULL;
FreeLibrary(pFun->hWtuxws32);
pFun->hWtuxws32 = NULL;
return -4;
}
释放时很简单,只需
FreeLibrary(pFun->hLibfml32);
FreeLibrary(pFun->hWtuxws32);
即可。
5、使用。例:...的内容查帮助吧。
PFUNTUXEDO pFun;
char *pSendBuff;
char *pRecvBuff;
long lRet;
short sRet;
int iRet;
//中间件服务
pSendBuff = pFun->tpalloc(...);
if (pSendBuff == NULL)
{
return ERR_TUXEDO;
}
pRecvBuff = pFun->tpalloc(...);
if (pRecvBuff == NULL)
{
pFun->tpfree(pSendBuff);
return ERR_TUXEDO;
}
try
{
iRet = pFun->Fchg32(...);
if (iRet == -1)
{
throw(1);
}
//建立连接
iRet = pFun->tpinit(NULL);
if (iRet == -1)
{
throw(2);
}
iRet = pFun->tpcall(...);
if (iRet == -1)
{
throw(3);
}
iRet = pFun->tpterm();
if (iRet == -1)
{
throw(4);
}
iRet =pFun->Fget32(...);
if (iRet == -1)
{
throw(4);
}
pFun->tpfree(pSendBuff);
pFun->tpfree(pRecvBuff);
}
catch(int Err)
{
pFun->tpfree(pSendBuff);
pFun->tpfree(pRecvBuff);
return Err;
}
catch(...)
{
return ERR_UNKNOWN;
}
//这里可以处理接收到的数据结果
//...
6、编译。
……