delphi – 遇到错误使用DataExplorer.exe连接到本地生长的DBX4驱动程序

delphi – 遇到错误使用DataExplorer.exe连接到本地生长的DBX4驱动程序,第1张

概述我在Delphi 2010中为Firebird数据库编写了自己的DBX 4。该驱动程序是一个动态链接驱动程序,它工作正常与TSQLConnection。 最近我尝试使用Delphi 2010发布的DataExplorer.exe遇到错误: "Attempted to read or write protected memory. This is often an indication that 我在Delphi 2010中为Firebird数据库编写了自己的DBX 4。该驱动程序是一个动态链接驱动程序,它工作正常与TsqlConnection。

最近我尝试使用Delphi 2010发布的DataExplorer.exe遇到错误:

"Attempted to read or write protected memory. This is often an indication that other memory is corrupt".

跟踪源代码后,我发现以下导出方法可能是导致问题的原因:

function DBXLoader_GetDriver(Count: TInt32; names,Values: TWIDeStringArray;  ErrorMessage: TDBXWIDeStringBuilder; out pDriver: TDBXDriverHandle):  TDBXErrorCode; stdcall;

调试此方法时,names和Values参数包含损坏的值。我不知道是什么原因造成的。也许DataExplorer.exe有一些内存管理器问题(.net问题?)

经过一番试错,我尝试将方法改为:

type  TWIDeStringArray2 = array of PChar;function DBXLoader_GetDriver(Count: TInt32; names,Values: TWIDeStringArray2;  ErrorMessage: TDBXWIDeStringBuilder; out pDriver: TDBXDriverHandle):  TDBXErrorCode; stdcall;

这一次,错误消失,退出该方法后不久,同样的错误再次提高

"Attempted to read or write protected memory.This is often an indication that other memory is corrupt".

你有什么想法可能是什么原因的问题?

解决方法 看起来你有一些内存分配问题。您是否使用SimpleShareMem finalualy?

http://docwiki.embarcadero.com/CodeExamples/en/SimpleShareMem_Sample – 介绍如何使用它。

http://www.codexterity.com/memmgr.htm – 还包含一些关于内存分配的见解,但使用FastSharemem模块的旧版本。

总结

以上是内存溢出为你收集整理的delphi – 遇到错误使用DataExplorer.exe连接到本地生长的DBX4驱动程序全部内容,希望文章能够帮你解决delphi – 遇到错误使用DataExplorer.exe连接到本地生长的DBX4驱动程序所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1281662.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存