Beta8 compiler error

We encourage new members to introduce themselves here. Get to know one another and share your interests.
Post Reply
Juraj
Posts: 161
Joined: Mon Jan 09, 2017 7:00 am

Beta8 compiler error

Post by Juraj »

In my new application written in XS Core I use Errorhandler as an example of Wolfgang. The Beta7 compilation is OK. In Beta8 I get a XS1558 error ... I am attaching two screenschots and a small example.

Juraj
Attachments
WPFTestBeta8.zip
(41.97 KiB) Downloaded 41 times
Beta8.png
Beta8.png (82.53 KiB) Viewed 472 times
Beta7.png
Beta7.png (97.55 KiB) Viewed 472 times
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Beta8 compiler error

Post by robert »

Juraj,
We have changed the way the Start function gets called, to solve some problems that people reported with garbage collection before shutdown.
So we are now creating another kind of startup function, called __XsStart which contains the code to set the compiler options in the runtime and to clean up at the end.
Unfortunately this does now work well with the solution that you were using.
For now rename your start function to "__XsStart" and that should fix the problem. I will put this on the list of issues to fix for the next build.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Juraj
Posts: 161
Joined: Mon Jan 09, 2017 7:00 am

Beta8 compiler error

Post by Juraj »

Hi Robert,

Thank you for the quick answer, after renaming the compilation is without error.

Still note about testing VS2019. If I try to open xaml file in VS2019, VS2019 freezes. WinForms, or PRG editor works OK, the problem is only when trying to edit the XAML file.

Juraj
George
Posts: 106
Joined: Thu Nov 05, 2015 9:17 am

Beta8 compiler error

Post by George »

Hi,

I had a problem with X# 2.0.0.8 and the .Net Reactor obfuscator:

the obfuscated EXE that .Net Reactor V.5.0.0.0 procudes, didn't run.
it behaved like some DLL was missing.

Changing the Start() with __XsStart() it works.
Can you please check the .Net Reactor generated EXE as well ?

regards
George
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Beta8 compiler error

Post by robert »

George,
I don't have .Net Reactor.
Where can I download a version ?

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
George
Posts: 106
Joined: Thu Nov 05, 2015 9:17 am

Beta8 compiler error

Post by George »

Robert,

https://www.eziriz.com/downloads.htm

please note I am using Vulcan dialect and the 2 Vulcan RT DLLs are included into the reactor file (attached here as sample).

George
Attachments
Eye.zip
(10.43 KiB) Downloaded 41 times
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am

Beta8 compiler error

Post by Karl-Heinz »

Hi Robert,

when i compile the structure with 2.0.0.8 a classvar modifier like PUBLIC must be added. But how does this work if a member needs a MarshalAs attribute ?

Code: Select all


STRUCTURE OSVERSIONINFOEX   
    PUBLIC dwOSVersionInfoSize AS DWORD 
    PUBLIC dwMajorVersion AS DWORD
    PUBLIC dwMinorVersion AS DWORD
    PUBLIC dwBuildNumber AS DWORD 
    PUBLIC dwPlatformId  AS DWORD
 
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst := 128)] ; 
           szCSDVersion AS STRING          

//  PUBLIC [MarshalAs(UnmanagedType.ByValTStr, SizeConst:=128)] szCSDVersion AS STRING

    PUBLIC wServicePackMajor AS WORD 
    PUBLIC wServicePackMinor AS WORD 
    PUBLIC wSuiteMask AS WORD 
    PUBLIC wProductType AS BYTE 
    PUBLIC wReserved AS BYTE 
    
    
END STRUCTURE

i´ve tried several possibilties to insert "PUBLIC" , but it always ends up in a parser error

regards
Karl-Heinz
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Beta8 compiler error

Post by robert »

Karl Heinz,
Attributes come before everything else. For example
STRUCTURE OSVERSIONINFOEX
[MarshallAs.....];
PUBLIC dwOSVersionInfoSize AS DWORD
PUBLIC dwMajorVersion AS DWORD
If you put the attribute on a separate line like in the example above then you need to end that line with a semi colon.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am

Beta8 compiler error

Post by Karl-Heinz »

Aaaaaaargh ...

got it.

thanks !
George
Posts: 106
Joined: Thu Nov 05, 2015 9:17 am

Beta8 compiler error

Post by George »

Robert,

the Start() works if the assembly is Windows Service EXE:

// Start.prg
USING System
USING System.ServiceProcess
USING System.Diagnostics

FUNCTION Start() AS VOID
ServiceBase.Run(MyService{})
RETURN

regards
George
Post Reply