简体   繁体   English

为什么升级后 bpl 会出现 Error Loading a resource string?

[英]Why does bpl has Error Loading a resource string after upgrade?

We have a bpl that has some resource (.rc) files which has strings in it.我们有一个 bpl,其中包含一些资源 (.rc) 文件,其中包含字符串。 It is defined via STRINGTABLE and loaded via a LoadStr() call.它通过STRINGTABLE定义并通过LoadStr()调用加载。 The project was in version 10.1 Berlin.该项目的版本为 10.1 Berlin。 We upgraded to the latest 11.1 Alexandria and now the call returns NULL .我们升级到最新的 11.1 Alexandria,现在调用返回NULL So to test I added the line at the main所以为了测试我在主要添加了这一行

extern "C" int _libmain(unsigned long reason)
{
  String str = LoadStr(231); **// Works**
  return 1;
}

but the existing code below does not work.但下面的现有代码不起作用。

**.h**
PACKAGE String __fastcall GetValueSetDesc(int ACount);

**.cpp**
String __fastcall GetValueSetDesc(int ACount)
{
  String ValueDesc = LoadStr(ACount); **// Does not work, retuns NULL**
  return ValueDesc;
}

I tried creating the project from scratch (and adding files to it).我尝试从头开始创建项目(并向其中添加文件)。 Any one has experienced this issue or know what to try?有没有人遇到过这个问题或知道要尝试什么?

The problem was with DevExpress components.问题出在 DevExpress 组件上。 The call was from a DevExpress change event.该调用来自 DevExpress 更改事件。 A call from a non DevExpress component worked fine.来自非 DevExpress 组件的调用工作正常。 The way I solved this is to re-create the cbproj from scratch and add the files, settings etc (in the exe, the bpl seems fine).我解决这个问题的方法是从头开始重新创建 cbproj 并添加文件、设置等(在 exe 中,bpl 似乎很好)。 Man, DevExpress gave me a lot of grief this time around when we upgraded!伙计,这次我们升级时,DevExpress 让我很伤心!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM