寻求C++语言转议C#语言帮助

homebigcat 2006-10-25 01:02:25
原代码如下:

// 8.ページ認識
DWORD CComlibcall::OcrlibRTSub(char* pszReturnCode, char* pszCodeData, long lCodeDataSize)
{
DWORD dwStatus = RET_COMPLETE;

try
{
BYTE byComLibData[4096];
::ZeroMemory(&byComLibData[0], sizeof(BYTE) * 4096);
OCRLPRMTR* ptOcrLibParam = (OCRLPRMTR *)(&byComLibData[0]);
ptOcrLibParam->size = sizeof(RTIn);
RTIn* ptRTIn = (RTIn *)ptOcrLibParam->info;
RTOut* ptRTOut = (RTOut *)ptOcrLibParam->info;
ptRTIn->addr = (unsigned char *)pszCodeData;
ptRTIn->size = lCodeDataSize;

DWORD dwRet = OcrlibRT(ptOcrLibParam);

char szRetString[256];
if(dwRet == OCRL_OK)
{
strcpy(&szRetString[0], "00000000");
ReturnCodeDef(&szRetString[0], pszReturnCode);
}
else
{
RTNg* ptRTNg = (RTNg *)ptOcrLibParam->info;
::ZeroMemory(&szRetString[0], sizeof(char) * 256);
::CopyMemory(&szRetString[0], ptRTNg, sizeof(RTNg));
ReturnCodeDef(&szRetString[0], pszReturnCode);
dwStatus = RET_FAILED;
}
}
catch(CMemoryException* e)
{
e->Delete();
dwStatus = RET_PROGRAM_FAILED;
}
catch(...)
{
dwStatus = RET_PROGRAM_FAILED;
}

return dwStatus;

...全文
82 回复 打赏 收藏 举报
写回复
回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
相关推荐
发帖
C#

10.8w+

社区成员

.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
帖子事件
创建了帖子
2006-10-25 01:02
社区公告

让您成为最强悍的C#开发者