delphi动态加载包,出现Application is not licensed to use this feature异常?请教高手!!

sunnauq 2009-09-24 02:14:32
delphi6动态加载包,并调用包中export出的一个方法,此方法创建包中的一个窗体,执行方法时出现Application is not licensed to use this feature异常?将工程属性中的Build with runtime packages选项选中后,就没有那个错误了。请高手帮忙解释一下,这是什么原因。谢谢了!

...全文
510 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
sunnauq 2009-09-25
  • 打赏
  • 举报
回复
谢谢,能在具体一点儿吗?
wxieyang 2009-09-25
  • 打赏
  • 举报
回复
怎么写入资源文件, Google 吧, 查下 Delphi 资源文件
应该能找到吧

还有一点你需要注意,我用的是delphi7,你用的是Delphi6,这个资源是不一样的,你需要自己获得下。
用Delphi6编译一个exe文件,然后在这个文件中把DVCLAL这个资源读出来。下面是一个简单的读资源的代码
procedure TForm1.Button1Click(Sender: TObject);
var
I: Integer;
n: DWORD;
P, Q: Pointer;
S: AnsiString;
begin
n := SizeofResource(MainInstance, FindResource(MainInstance, 'DVCLAL', RT_RCDATA));
P := Pointer(LoadResource(MainInstance, FindResource(MainInstance, 'DVCLAL', RT_RCDATA)));
if P <> nil then
try
Memo1.Clear;
Q := P;
S := '';
for i := 0 to n - 1 do
begin
S := S + '$' + IntToHex(PByte(Q)^, 2) + ',';
Inc(PByte(Q));
end;
Memo1.Lines.Add(S);
finally
FreeResource(Integer(P));
end;
end;
sunnauq 2009-09-25
  • 打赏
  • 举报
回复
呵呵,怎么写入啊
alanhao 2009-09-25
  • 打赏
  • 举报
回复
环境变量可能没有初始化吧
wxieyang 2009-09-25
  • 打赏
  • 举报
回复
其实问题应该出在调用你的bpl的主程序中没有编译进去那个资源串导致的,那个资源串的名字叫
DVCLAL
其内容与你使用的delphi版本有关。
我使用的Delphi7 Client/server 版的内容如下(长度16字节)
$26,$3D,$4F,$38,$C2,$82,$37,$B8,$F3,$24,$42,$03,$17,$9B,$3A,$83

你可以试着把这个资源硬性写入到主程序的资源文件中,不知道是否好使
wxieyang 2009-09-24
  • 打赏
  • 举报
回复
这是Delphi限制包的方式发布系统的一种方式,也许是一种盗版限制吧,我可以告诉你是在哪里引起的错误,但是,如何解决,我忘记了,时间太久了,好像当时是处理下资源文件就可以了。
这个异常是在 SysUtils 单元的 procedure ALV 函数抛出的。
调用这个函数的地方也在这个单元中,你查下就可以了。
我记得是好像因为在编译bpl时在资源文件中缺少某个资源串导致的,你想办法把这个资源串加入到资源中就可以了
sunnauq 2009-09-24
  • 打赏
  • 举报
回复
谢谢,我这里应该不存在版本的问题,我想关键是Build with runtime packages这个选项,选与不选,对exe和动态加载的bpl,以及各个bpl之间产生什么影响。等待高人。
de410 2009-09-24
  • 打赏
  • 举报
回复
What is the cause of the error "Application is not licensed to use this feature"?

Answer:

This error occurs when you try to use components from one version of Delphi, such as Enterprise, with a different version that does not include those components, such as Standard. For example if you try to install the database components from the Enterprise version of Delphi into a Standard installation of Delphi.

Another possible cause is if you have the Standard version of Delphi installed on your machine and you install the Professional or Enterprise version without first uninstalling the Standard version. This error may also occur if you move a project from one version to another and keep the same compiled units (.dcu). It is best to delete the .dcu files and let them be recreated automatically.

Note: It is fine to have two different release versions of Delphi on your machine, such as Delphi 4 and Delphi 5, but not two versions of the same release such as Delphi 5 Standard and Delphi 5 Enterprise.

5,386

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧