Hi Wolfgang,
Ah, thanks for sending the sample, I see what's causing the problem. It's because of the enabled /vo5 (implicit CLIPPER calling convention) compiler option, which makes all methods that have no parameters be emitted as CLIPPER calling convention methods, for compatibility with VO.
To fix this (if you don't want to keep the parameter arguments) without disabling /vo5, you need to add a STRICT clause to the Start() method definition.
Possibly error message when starting program with missing included DLL
Re: Possibly error message when starting program with missing included DLL
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Re: Possibly error message when starting program with missing included DLL
Hi Chris,
thank you very much for looking into it!
IMHO it is completely the same if I add the parameters or the strict modifier... it is only to know that some change is needed.
But there is a small difference between the Start() function in VO and X#: in VO it is untyped and returns nil, in X# it needs to be typed and must return an int.
I have to change that after every migration.
Wolfgang
thank you very much for looking into it!
IMHO it is completely the same if I add the parameters or the strict modifier... it is only to know that some change is needed.
But there is a small difference between the Start() function in VO and X#: in VO it is untyped and returns nil, in X# it needs to be typed and must return an int.
I have to change that after every migration.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Re: Possibly error message when starting program with missing included DLL
Hi Wolfgang,
It can also return VOID in X#. But doesn't the VOXporter do the necessary change?
It can also return VOID in X#. But doesn't the VOXporter do the necessary change?
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Re: Possibly error message when starting program with missing included DLL
Wolfgang,
Your code works very well.
I added the following to the Start() function and the error is caught and shown correctly
Robert
Your code works very well.
I added the following to the Start() function and the error is caught and shown correctly
Code: Select all
nExitCode := 1/nExitCode
Code: Select all
An unhandled exception has occurred
===================================
Exception: Attempted to divide by zero.
Callstack:
at Functions.Start() in C:\XIDE\Projects\Default\Applications\StartupExceptionTester2\Prg\Start.prg:line 77
at XStartupCode.Start() in C:\XIDE\Projects\Default\Applications\StartupExceptionTester2\Prg\Start.prg:line 18
===================================
Press Return to close the application
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
Re: Possibly error message when starting program with missing included DLL
Hi Robert, all,
I have documented that also here:
https://docs.xsharp.it/doku.php?id=code ... am_startup
So that it will not go lost over time.
If there is anything I should also add there please let me know.
Wolfgang
I have documented that also here:
https://docs.xsharp.it/doku.php?id=code ... am_startup
So that it will not go lost over time.
If there is anything I should also add there please let me know.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Re: Possibly error message when starting program with missing included DLL
Hi Wolfgang,
Your code looks great, except for a couple small problems:
1. You did not declare the Start() method as STRICT, so if the /vo5 compiler option is enabled in the app, then the compiler will not find this method (as we discussed earlier).
2. The preprocessor will translate Wait to _Wait() by default (unless you have disabled using the standard preprocessor directives with /nostddefs (in XIDE it's in the advanced page of the app properties), so you need to use a different name for this function. Or you can simply directly call Console.ReadLine() instead of calling an intermediate function.
3. The call to Functions.Start() is ambiguous. Instead you need to specify the full name, like AppName.Exe.Functions.Start(). Or rename the original Start() function so something like StartApp() and simply call StartApp() from inside XStartupCode.Start()
Your code looks great, except for a couple small problems:
1. You did not declare the Start() method as STRICT, so if the /vo5 compiler option is enabled in the app, then the compiler will not find this method (as we discussed earlier).
2. The preprocessor will translate Wait to _Wait() by default (unless you have disabled using the standard preprocessor directives with /nostddefs (in XIDE it's in the advanced page of the app properties), so you need to use a different name for this function. Or you can simply directly call Console.ReadLine() instead of calling an intermediate function.
3. The call to Functions.Start() is ambiguous. Instead you need to specify the full name, like AppName.Exe.Functions.Start(). Or rename the original Start() function so something like StartApp() and simply call StartApp() from inside XStartupCode.Start()
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Re: Possibly error message when starting program with missing included DLL
Hi Chris,
you are right - I had mixed the samples (StartupExceptionTester is the Windows Forms sample, and StarupExceptionConsole is the VO dialect console program.
I will have to build a VO GUI sample later.
Wolfgang
you are right - I had mixed the samples (StartupExceptionTester is the Windows Forms sample, and StarupExceptionConsole is the VO dialect console program.
I will have to build a VO GUI sample later.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it