Delphi流媒体问题

发布于 2024-10-13 05:34:24 字数 653 浏览 3 评论 0原文

我使用 kbmMemTable 中的 blob 字段来存储我从 TComponent 开发的自定义组件,并使用 的读取和写入组件流方法>TReader 读取组件并将其写入 blob 字段。 kbmMemTable 中的数据最终存储在由 GpStructuredStorage 创建的结构化存储文件中。

这一切都完美无缺,直到我将我的组件(以及 kbmMemtable )移动到新应用程序并尝试让新应用程序读取 blob 字段。起初,我遇到了组件命名错误(组件名称已存在),但后来当 TReader 尝试读取组件的 TPercient 属性时,我开始遇到访问冲突。

据我所知,我没有对从 gpStructuredStorage 文件检索 kbmMemTable 数据的方式以及从 blob 读回组件的方式进行任何更改使用 TReader 的字段。我没有对组件进行任何更改,并且我存储在同一个表的其他 blob 字段中的其他组件似乎没有任何问题(至少在读取它们时我没有收到任何错误)后退)。

我对可能出现的问题感到恼火。任何帮助/建议将不胜感激。我使用的是Delphi 2007。

I'm using a blob field in a kbmMemTable to store a custom component that I've developed from TComponent and I use the read and write component stream methods of the TReader to read and write the component to the blob field. The data in the kbmMemTable is eventually stored inside a structured storage file created by GpStructuredStorage.

This has worked flawlessly, until I moved my component (along with the kbmMemtable) to a new application and tried to have the new application read the blob field. At first I was getting a component naming error (component name already exists), but later I started getting an Access Violation when the TReader tries to read a TPersistent property of my component.

As far as I know, I did not change anything with regards to the way I retrive the kbmMemTable data from the gpStructuredStorage file and the way I read the component back from the blob field using TReader. I've made no changes to the component and, I don't seem to have any problem with other components that I'm storing in other blob fields in the same table (at least I'm not getting any errors when they are read back).

I'm miffed at what could be the problem. Any help / suggestion would be greatly appreciated. I am using Delphi 2007.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

与风相奔跑 2024-10-20 05:34:24

另一个猜测。您的组件名称与其他/不同的组件名称冲突。要解决这个问题,请始终将您的单位放在其他渴望党的单位之后:
示例:

from: SysUtils, YourUnitClass, Classes;
to: SysUtils, Classes, YourUnitClass;

并确保注册您的组件

initialization
  RegisterClasses([TYourComponentClass]);

finalization
  UnRegisterClasses([TYourComponentClass]);

祝你好运

Another guess. Your component name is collited with other/different one. To resolve this, always make your unit(s) after other thirst party ones:
example:

from: SysUtils, YourUnitClass, Classes;
to: SysUtils, Classes, YourUnitClass;

and make sure to register your component

initialization
  RegisterClasses([TYourComponentClass]);

finalization
  UnRegisterClasses([TYourComponentClass]);

Gook luck

萌辣 2024-10-20 05:34:24

这只是一个猜测,但听起来新应用程序中的组件类定义与您正在流式传输的组件的定义不匹配。

This is just a guess, but it sounds like the component class definition in the new application does not match that of the component that you're streaming.

秋心╮凉 2024-10-20 05:34:24

我终于弄清楚是什么导致了流媒体问题 - 尽管我不确定为什么,所以也许有人可以解决这个问题。我决定检查问题是否可能是由我正在使用的某些新的第 3 方组件引起的,你瞧,当我禁用皮肤组件时(这将是我的新应用程序的改进!),一切都正常它应该有。通过禁用我的意思是我没有从程序中删除它,我只是做了它,以便压缩的皮肤不再用于绘制窗口和控件。

I finally figured out what caused the streaming problem - although I am not sure why so perhaps someone can throw a light on this issue. I decided to check if the problem could be caused by some of the new 3rd party components I was using and lo and behold, when I disabled a skinning component (which was going to be an improvement in my new app!), everything worked as it should have. By disabling I mean I did not remove it from the program, I just made it so that the compressed skins were no longer used to paint the windows and the controls.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文