Re: [fpc-pascal] stdcall without the ;

2020-09-24 Thread Santiago A. via fpc-pascal

El 23/09/2020 a las 19:45, Luca Olivetti via fpc-pascal escribió:

El 23/9/20 a les 17:38, Santiago A. via fpc-pascal ha escrit:

El 23/09/2020 a las 13:54, Luca Olivetti via fpc-pascal escribió:

Hello,

I just compiled a lazarus project made in 2105 with fpc 3.2.0 and, 
while it works here, it fails when the customer runs it.


What does "it fails" mean?
Any error message? Sigfault?



I'm not at the customer's site, but he told me that it does nothing, 
it shows nothing and it's not visible in the task manager.
What's worse, I have an application exception handler that logs the 
first unmanaged exception to a file and the halts the program, well, 
the customer says the file doesn't exist, so I presume there's no 
unmanaged exception or the application doesn't even reach the handler.


Bye

Little information ;-)

You could try a few things to get more data about what is the point 
where the program breaks:


 * Add some log  information (write to a log file, not through
   exception) in the lpr file before it starts the application run.
 * Add to the main form in the create constructor and in the formcreate
   event some log information.

If the programs doesn't starts at all, then probable you have any 
problem at binary level. That is usually hard the find. You could ask 
the customer to run it from cmd prompt. Sometimes it displays some 
informative message.


Once I had the problem that 32bits worked fine in my PC, but failed in 
customer's system. The problem was that I was using firebird but the 
customer had installed 64bits version, so the client library 
fbclient.dll was 64bits and exe 32bits. I copied a 32bits fbclient.dll 
to the exe directory and everything worked fine.


--
Saludos

Santiago A.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] stdcall without the ;

2020-09-24 Thread Luca Olivetti via fpc-pascal

El 23/9/20 a les 19:45, Luca Olivetti via fpc-pascal ha escrit:

El 23/9/20 a les 17:38, Santiago A. via fpc-pascal ha escrit:

El 23/09/2020 a las 13:54, Luca Olivetti via fpc-pascal escribió:

Hello,

I just compiled a lazarus project made in 2105 with fpc 3.2.0 and, 
while it works here, it fails when the customer runs it.


What does "it fails" mean?
Any error message? Sigfault?



I'm not at the customer's site, but he told me that it does nothing, it 
shows nothing and it's not visible in the task manager.
What's worse, I have an application exception handler that logs the 
first unmanaged exception to a file and the halts the program, well, the 
customer says the file doesn't exist, so I presume there's no unmanaged 
exception or the application doesn't even reach the handler.


It turns out everything's fine: I resent the exe, the previous one must 
have been corrupted in transit.


Bye
--
Luca

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] stdcall without the ;

2020-09-23 Thread Luca Olivetti via fpc-pascal

El 23/9/20 a les 17:38, Santiago A. via fpc-pascal ha escrit:

El 23/09/2020 a las 13:54, Luca Olivetti via fpc-pascal escribió:

Hello,

I just compiled a lazarus project made in 2105 with fpc 3.2.0 and, 
while it works here, it fails when the customer runs it.


What does "it fails" mean?
Any error message? Sigfault?



I'm not at the customer's site, but he told me that it does nothing, it 
shows nothing and it's not visible in the task manager.
What's worse, I have an application exception handler that logs the 
first unmanaged exception to a file and the halts the program, well, the 
customer says the file doesn't exist, so I presume there's no unmanaged 
exception or the application doesn't even reach the handler.


Bye
--
Luca

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] stdcall without the ;

2020-09-23 Thread Luca Olivetti via fpc-pascal
Nevermind, I checked with -s -a and the generated assembler is the same, with 
or without the ';'

Bye
--
Luca

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] stdcall without the ;

2020-09-23 Thread Santiago A. via fpc-pascal

El 23/09/2020 a las 13:54, Luca Olivetti via fpc-pascal escribió:

Hello,

I just compiled a lazarus project made in 2105 with fpc 3.2.0 and, 
while it works here, it fails when the customer runs it.


What does "it fails" mean?
Any error message? Sigfault?

--
Saludos

Santiago A.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] stdcall without the ;

2020-09-23 Thread Luca Olivetti via fpc-pascal
I did more than that, I created a DLL that simulates the hardware (it's a 
phidget I/O board) and it works perfectly, both with the old and the new 
executable.
Thank you for the idea.

Bye
--
Luca

23 sept. 2020 15:33:05 Michael Van Canneyt :

> On Wed, 23 Sep 2020, Luca Olivetti via fpc-pascal wrote:
> 
>> But I don't have the hardware managed by the DLL so the callbacks are never 
>> called here.
> 
> Can't you create a stub DLL to test? it doesn't need to do anything, just log 
> the params maybe...
> 
> Michael.
> 
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] stdcall without the ;

2020-09-23 Thread Michael Van Canneyt via fpc-pascal



On Wed, 23 Sep 2020, Luca Olivetti via fpc-pascal wrote:


But I don't have the hardware managed by the DLL so the callbacks are never 
called here.


Can't you create a stub DLL to test? 
it doesn't need to do anything, just log the params maybe...


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] stdcall without the ;

2020-09-23 Thread Luca Olivetti via fpc-pascal
But I don't have the hardware managed by the DLL so the callbacks are never 
called here.

Bye
--
Luca

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] stdcall without the ;

2020-09-23 Thread Michael Van Canneyt via fpc-pascal



On Wed, 23 Sep 2020, Luca Olivetti via fpc-pascal wrote:


Hello,

I just compiled a lazarus project made in 2105 with fpc 3.2.0 and, while 
it works here, it fails when the customer runs it.


I noticed that I'm using a dll and the functions and callbacks are 
declared stdcall (the platform is win32) but without the ;, i.e.:


function OnAttach(handle: pointer; userdata: ptrint): Integer stdcall;


instead of

function CPhidgetInterfaceKit_create(var handle: Pointer):Integer; stdcall;


The project compiles fine, could it be that the missing ';' causes the 
stdcall not to be taken into account?


I doubt it because then it would also not run for you ?

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] stdcall without the ;

2020-09-23 Thread Luca Olivetti via fpc-pascal

Hello,

I just compiled a lazarus project made in 2105 with fpc 3.2.0 and, while 
it works here, it fails when the customer runs it.


I noticed that I'm using a dll and the functions and callbacks are 
declared stdcall (the platform is win32) but without the ;, i.e.:


function OnAttach(handle: pointer; userdata: ptrint): Integer stdcall;


instead of

function CPhidgetInterfaceKit_create(var handle: Pointer):Integer; stdcall;


The project compiles fine, could it be that the missing ';' causes the 
stdcall not to be taken into account?


Bye
--
Luca
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal