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

TQuery in a runtime package

3 views
Skip to first unread message

raulmola

unread,
Oct 9, 2006, 11:16:52 AM10/9/06
to
Hello, i have a package, lets call it CommonFunctionspackage.bpl, and
an application that uses it. Inside this package i have an exported
function that looks as simple as this

extern PACKAGE void __fastcall Prueba();


void __fastcall Prueba()
{
TQuery *q= new TQuery(NULL); //-- Crashes here, in the new
delete q ;
}


If i compile it with mypackage.bpl included as a runtime package it
crashes

But if icompile statically ( without mypackage.bpl included as a
runtime package) it all goes ok.

Does anyone knows what could be the reason of this ?

This would mean that i couldn't do TQuery's in runtime packages, that
can't be possible. Am i missing something?

I want the packge to be a runtime package because, the package is
intended to contain functions common to several "exe", and i don't want
to compile every "exe" statically with this package . This is, i want
to make my "exes" modular

I can't debug into VCL because as i read out there, because it's not
possible to debug with runtime packages.

raulmola

unread,
Oct 9, 2006, 11:35:34 AM10/9/06
to
By the way... the error reported by borland debugger is this :


---------------------------
Debugger Exception Notification
---------------------------
Project modinvoicProject10A.exe raised exception class EAccessViolation
with message 'Access violation at address 406F1770 in module
'bdertl60.bpl'. Read of address 0000003C'. Process stopped. Use Step or
Run to continue.
---------------------------
OK Help
---------------------------

raulmola ha escrito:

raulmola

unread,
Oct 16, 2006, 4:13:26 AM10/16/06
to
I found it myself !!!!

My exe was compiled with bdertl.bpl statically and my bpl was compiled
it with the bdertl.bpl dinamically and this caused this error. So take
care of which runtime packages you compile with your bpl and your exes.
As a rule i will compile all my bpls and exes with at least, the
common runtime packages as runtime packages in both.That is, if there
exists an A.EXE with X.BPL as a runtime package then, those Y.BPL that
A.EXE depends on, will be compiled with X.BPL as a runtime package(and
viceversa).

I hope this helps.


raulmola ha escrito:

0 new messages