在Dll中调用ocx出错
我在用delphi写的dll中调用了ocx控件,dll的导出函数用到了widestring
Dll入口函数
procedure DLLEntryPoint(dwReason: DWord);stdcall;
begin
case dwReason of
DLL_PROCESS_ATTACH:
begin
CoInitialize(NIL);
ICSeat:= CreateOleObject('ICC.IC_S') as IC_Seat;
end;
DLL_PROCESS_DETACH:
begin
CounInitialize;
end;
DLL_THREAD_ATTACH: ;
DLL_THREAD_DETACH: ;
end;
end;
两个导出函数
function Ding_Ring(DR_Port_Com: Smallint; DR_Num: Byte; DR_Time: Byte): Smallint; stdcall;
begin
result := ICSeat.Ding_Ring(DR_Port_Com, DR_Num, DR_Time);
//这句可以调用 但返回的时候出错 too many consecutive exceptions 'access violation at 0x.....
end;
function Read_Card(RC_Port_Com: Smallint; var RC_Str_Card: WideString): Smallint; stdcall;
begin
result := ICSeat.Read_Card(RC_Port_Com, RC_Str_Card);
end;
调用任何一个使用了ICSeat的导出函数都会出错
too many consecutive exceptions 'access violation at 0x.....
原本怀疑是dll导出函数的参数用了string的原因
后 在dll的project文件及测试dll的exe文件都有调用SharMem(放在第一个),还是出错
请高手帮忙指点一下
Dll入口函数
procedure DLLEntryPoint(dwReason: DWord);stdcall;
begin
case dwReason of
DLL_PROCESS_ATTACH:
begin
CoInitialize(NIL);
ICSeat:= CreateOleObject('ICC.IC_S') as IC_Seat;
end;
DLL_PROCESS_DETACH:
begin
CounInitialize;
end;
DLL_THREAD_ATTACH: ;
DLL_THREAD_DETACH: ;
end;
end;
两个导出函数
function Ding_Ring(DR_Port_Com: Smallint; DR_Num: Byte; DR_Time: Byte): Smallint; stdcall;
begin
result := ICSeat.Ding_Ring(DR_Port_Com, DR_Num, DR_Time);
//这句可以调用 但返回的时候出错 too many consecutive exceptions 'access violation at 0x.....
end;
function Read_Card(RC_Port_Com: Smallint; var RC_Str_Card: WideString): Smallint; stdcall;
begin
result := ICSeat.Read_Card(RC_Port_Com, RC_Str_Card);
end;
调用任何一个使用了ICSeat的导出函数都会出错
too many consecutive exceptions 'access violation at 0x.....
原本怀疑是dll导出函数的参数用了string的原因
后 在dll的project文件及测试dll的exe文件都有调用SharMem(放在第一个),还是出错
请高手帮忙指点一下
...全文
相关推荐
专门查看DLL动态连接库或者OCX控件的导出函数的工具,对编程开发者很实用. 更新了读取文件出错的BUG!
专门查看DLL动态连接库或者OCX控件的导出函数的工具,对编程开发者很实用. 更新了读取文件出错的BUG! 1.5更新:修正读取函数出错的BUG
ocx,DLL注册的工具
ocx,dll注册工具很好用的1111111111
计算机软件-编程源码-ocx-dll自动注册.zip
计算机软件-编程源码-ocx-dll自动注册.zip
WEB载入OCX控件教程(VC的OCX教程完整版)
包括OCX的制作、WEB页面载入、出错的提示等比较完整的教程
查看系统注册ocx及其属性,可注册or卸载
查看系统注册ocx及其属性,可注册or卸载 很好用,绿色,不用安装


Windows SDK/API
