Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Borland Packages

0 views
Skip to first unread message

Daimler

unread,
Oct 20, 2003, 4:54:39 AM10/20/03
to
Good day to all!
This is an urgent need. I need every help I can get.
I have created an application that calls a loads a package. Here is the code
of the executable application:

procedure TfrmMain.Button3Click(Sender: TObject);
var
phm: HMODULE;
LoadSheet: function: Boolean;
begin
phm := LoadPackage('G:\Delphi Rep\Packages\Curriculum Maintenance\' +
'CurriculumMaintenance.bpl');
if phm <> 0 then begin
try
@LoadSheet := GetProcAddress(phm, 'Execute');
if Assigned(LoadSheet) then LoadSheet
else ShowMessage('Function not found.');
finally
UnloadPackage(phm);
end;
end
else ShowMessage('Package not found!');
end;

======================================================
Here's the code of the package's main form filename: urfmReg004S.

function Execute(): Boolean;
begin
frmReg004S := TfrmReg004S.Create(Nil);
try
frmReg004S.ShowModal;
finally
frmReg004S.Release;
end;
end;
.
.
.
exports
Execute;

=======================================================
I have also placed a code in the OnCreate event of ufrmReg004S. The code
contains the creation of the package's data module. How come an error is
raised? it says "Application is not licensed to use this feature?" The line
where the error is raised contains: frmDataModule :=
TfrmDataModule.Create(Nil);


yc

unread,
Oct 20, 2003, 5:02:45 AM10/20/03
to
I am not sure if it helps,
what happens if you use Free instead of Release,
because , as far as I know they are not identical.

Daimler

unread,
Oct 20, 2003, 5:13:18 AM10/20/03
to
but the main problem is in the OnCreate event of the main form. the error
arises from the line where i create my data module.


"yc" <y...@yc.yc> wrote in message news:3f93a4cb$1...@newsgroups.borland.com...

Cruxy

unread,
Oct 20, 2003, 5:22:23 AM10/20/03
to
Maybe you use some component on the to creating Form containing
components NOT allowed to be redistributed used. If the problem occures
only outside the IDE it is much likely a restriction to a component you
use.
See "Software License Requirements" in Delphi Help...

Cruxy

unread,
Oct 20, 2003, 8:32:35 AM10/20/03
to
> I am not sure if it helps,
> what happens if you use Free instead of Release,
> because , as far as I know they are not identical.

Free terminates the Object from memory;
Release calls an interface routine -> depending how the routine is done
if freed or not or whatever.

If you use "normal" Objects, use Create & Free (or Create and Close on
forms);
If you use interfaces you'd use the Release routine (Details see Delphi
Help).

Marc Rohloff

unread,
Oct 20, 2003, 9:44:11 AM10/20/03
to
> I have also placed a code in the OnCreate event of ufrmReg004S. The code
> contains the creation of the package's data module. How come an error is
> raised? it says "Application is not licensed to use this feature?" The line
> where the error is raised contains: frmDataModule :=
> TfrmDataModule.Create(Nil);
IIRC. This happens when an application built with, say, Delphi Personal
(which doesn't have licenses to use the database stuff) tries to load a
package which uses database stuff. Ditto for Midas and Web stuff.

Marc

Ignacio Vazquez

unread,
Oct 20, 2003, 11:18:31 AM10/20/03
to
"Cruxy" <cruxyATcruxyDOTnet> wrote in message
3f93d5e3$1...@newsgroups.borland.com...

> Release calls an interface routine -> depending how the routine is done
> if freed or not or whatever.

You're thinking about _Release. The Release method (no underscore) posts a
message to the message queue telling a form to free itself. This is
typically used in code inside an event of the form.

Cheers,
Ignacio

--
No, don't send me e-mail directly. No, just don't.


Daimler

unread,
Oct 20, 2003, 10:38:52 PM10/20/03
to

It seems that the creation of my Data Module is the only problem when I load
the package. This line is the line that raises the error: frmDataModule :=
TfrmDataModule.Create(Nil). The creation of other forms have no problems.
Why is it like that?


Marc Rohloff

unread,
Oct 21, 2003, 10:06:10 AM10/21/03
to
On Tue, 21 Oct 2003 10:38:52 +0800, Daimler<ma...@smu.edu.ph> said ...

I answered this a few messages back. If you feel like you are not getting
an answer you will have to post more details or better yet a complete
example to the attachments group.

Marc

0 new messages