Re: [fpc-pascal] DLL calling Firebird 2: crashes at the end

2014-09-29 Thread Graeme Geldenhuys
On 2014-09-28 10:32, Michael Van Canneyt wrote: I do a lot of work with firebird embedded, and I've never even come close to the problems you're experiencing ? +1 Using Embedded and C/Server in a few projects under Windows and Linux (unofficial support) and it works fine here too. I use FPC's

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Mark Morgan Lloyd
Reinier Olislagers wrote: Apparently my crashes in a dll that use Firebird have to do with initialization sections in my business layer creating a single instance of my db layer. Distilled reproducible code that demonstrates problem:

Re: [fpc-pascal] Is it possible to use top directory of subtree with -Fu -Fi -Fl options?

2014-09-29 Thread leledumbo
So, is there a way to do this, i.e., specify the 'root' director for your units/includes and have it look at all files underneath regardless of nesting level? No, that's how -Fu is designed. -- View this message in context:

[fpc-pascal] Internal error 200706094

2014-09-29 Thread Victor Matuzenko
Hi! I have a large project and it compiles under 32 bits cpu, but doesn't under 64 bits. Here is a minimal problematic part: = [doj@larion ~/temp]$ cat ptrtransform.pas {$MODE OBJFPC} const C = -1; var A: array[0..1] of Pointer; begin

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Reinier Olislagers
On 29/09/2014 11:19, Mark Morgan Lloyd wrote: Reinier Olislagers wrote: 2. In businesslayer.pas, $define CRASH to see the problem. The code in question is: initialization DBLayer:=TDBInterface.Create; finalization DBLayer.Free; ... so probably initialization order plays a part?!?

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Reinier Olislagers
On 29/09/2014 11:19, Mark Morgan Lloyd wrote: Reinier Olislagers wrote: What happens if you move the responsibility for initialising and closing the database connection to the app-level code? In other words, the app does something like Ok, after eliminating some PEBKAC, my real dll works

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread José Mejuto
El 29/09/2014 a las #4, Reinier Olislagers escribió: What I would like to know what is the cause of this problem - dlls being loaded before some kind - what kind? - of initialization is complete? Anyway, I'll keep digging; probably first looking at geting postgresql support in anyway.

Re: [fpc-pascal] Is it possible to use top directory of subtree with -Fu -Fi -Fl options?

2014-09-29 Thread waldo kitty
On 9/29/2014 5:00 AM, Tony Papadimitriou wrote: OK, I think I realized what the problem is. The * will apparently search in all subdirectories but (apparently again) one level deep. So, if you have something like: \progs\pascal\units\a \progs\pascal\units\a\b and you give

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Reinier Olislagers
On 29/09/2014 16:51, José Mejuto wrote: El 29/09/2014 a las #4, Reinier Olislagers escribió: You must not initialize dbengine in the Initialization section and must not finalize it in that place (maybe only as last chance) because initialization order and finalization order is undefined by fpc

Re: [fpc-pascal] Internal error 200706094

2014-09-29 Thread waldo kitty
On 9/29/2014 5:48 AM, Victor Matuzenko wrote: IMO the problem is the transformation -1 into an unsigned value. (Unsigned(-1) Max(Signed).) How can I rewrite this code to make it correct? I want to use constants to calculate offsets from untyped pointer. have you tried using a typed const?

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Mark Morgan Lloyd
Reinier Olislagers wrote: On 29/09/2014 11:19, Mark Morgan Lloyd wrote: Reinier Olislagers wrote: 2. In businesslayer.pas, $define CRASH to see the problem. The code in question is: initialization DBLayer:=TDBInterface.Create; finalization DBLayer.Free; ... so probably initialization

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Reinier Olislagers
On 29/09/2014 17:41, Mark Morgan Lloyd wrote: Reinier Olislagers wrote: On 29/09/2014 11:19, Mark Morgan Lloyd wrote: Reinier Olislagers wrote: 2. In businesslayer.pas, $define CRASH to see the problem. The code in question is: initialization DBLayer:=TDBInterface.Create; finalization

Re: [fpc-pascal] Reproducible code: DLL calling Firebird crashes

2014-09-29 Thread Mark Morgan Lloyd
Reinier Olislagers wrote: On 29/09/2014 17:41, Mark Morgan Lloyd wrote: Reinier Olislagers wrote: On 29/09/2014 11:19, Mark Morgan Lloyd wrote: Reinier Olislagers wrote: 2. In businesslayer.pas, $define CRASH to see the problem. The code in question is: initialization

[fpc-pascal] how do I get Run Time info from a published method?

2014-09-29 Thread Dennis Poon
say for example: type TmyClass = class published procedure Something (sender : Tobject);virtual; end; var myClass : TmyClass; then somewhere AddMethodToQueue(@myclass.Something); Is it possible within AddMethodToQueue, I can query the Run Time Type Info of