//C 接口
extern "C"
{
TESSDLL_API int __cdecl GetTessText(const char *imagefile, char *text);
}//我在C#中声明
//调用C DLL 中的函数
[DllImport("OCRapi.dll", EntryPoint = "GetTessText", CharSet = CharSet.Ansi,
CallingConvention = CallingConvention.Cdecl)]
public static extern int GetTessText(char[] imagefile, char[] text);
调用代码:
char[] imagefile = "D:\\My Documents\\\baidu\\1.bmp".ToCharArray();
char[] textResult = new char[256];
int i = OCRAPI.GetTessText(imagefile, textResult);出现的问题:textResult 得不到返回值
extern "C"
{
TESSDLL_API int __cdecl GetTessText(const char *imagefile, char *text);
}//我在C#中声明
//调用C DLL 中的函数
[DllImport("OCRapi.dll", EntryPoint = "GetTessText", CharSet = CharSet.Ansi,
CallingConvention = CallingConvention.Cdecl)]
public static extern int GetTessText(char[] imagefile, char[] text);
调用代码:
char[] imagefile = "D:\\My Documents\\\baidu\\1.bmp".ToCharArray();
char[] textResult = new char[256];
int i = OCRAPI.GetTessText(imagefile, textResult);出现的问题:textResult 得不到返回值
解决方案 »
- 调用WSDL生成的webservice代理类报错 [(407) Proxy Authentication Required]
- stringsplitoptions 无效
- 有关C#配置数据源的问题。。。
- 反射效率问题
- (100分求)在域控制器上怎么知道用户什么时间注销
- [请教][难度问题]按钮事件中有循环的问题,用另一个按钮控制停止,暂停,继续
- 求支持中文文件名 FTP上传/下载的代码
- Crystal Reports分组问题
- string 加解码
- 多线程下载:一个用户端从多个服务器下载同一文件,即每一线程负责与一服务器连接下载数据。
- C#
- 如何创建Windows Services, 使其每隔六个小时启动一次.
CallingConvention = CallingConvention.Cdecl)]
public static extern int GetTessText(string imagefile, StringBuilder text);
[DllImport("OCRapi.dll", EntryPoint = "GetTessText", CharSet = CharSet.Ansi,
CallingConvention = CallingConvention.Cdecl)]
public static extern int GetTessText(byte[] imagefile, string text);
?OCRapi.dll,功能是什么? 参数是输入,还是返回,楼主没说清.如果输入是图形文件,输出是文本,文字识别软件,返回的参数前加 ref string 输入应该是 byte[] 实际如何,这些在函数原型的文档中应该有说明的.
CallingConvention = CallingConvention.Cdecl)]
public static extern int GetTessText(string imagefile, string text);