Sample of a migrated VO application

This forum is meant for examples of X# code.

User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Sample of a migrated VO application

Post by wriedmann »

For a few days I'm now using my FTPExplorer application in its X# version.

This application is an evolution of the VO FTPExplorer sample with several additions like resizeable window.
I have moved this application to Vulcan.NET a few years ago, and now it is a X# application using the Vulcan.NET runtime libraries.

To show you how such an application feels you will find different files in the attached zip archive:
- the X# compiled exe
- a VIAEF file with the complete sources in XIDE format - simply startup XIDE and import this file in anyone of your projects.
- a Vulcan compiled exe with the needed runtime DLLs

But be warned: this code is not well written code you should take as example - take it as example how old code with errors and bad style can continue to run in a X# version.
And this application originally was built in a multilingual version, but the code you find attached contains only the german language.

Changed February, 6 2017 17:21: fixed a runtime error when resizing
Attachments
FTP_Explorer_Xsharp.zip
(1.35 MiB) Downloaded 29 times
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
FFF
Posts: 1521
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Sample of a migrated VO application

Post by FFF »

Wolfgang,
got the files. ...Vulcan.exe works, but the X-exe crashes when i try to change the shell size by mouse. Imported the aef, Xide complains about missing AFTPICO Icon "aFtpIco.ico". Took any icon file, renamed. Compiled then in XIDE, but result of resize is the same...

BTW, 303 warnings re "double define" is not so nice ;) - @Chris: any chance to let the error pane provide a means to actually SEE where the second define hides? A Ctrl-Shift-F shows only the define in Win32Api.
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Sample of a migrated VO application

Post by wriedmann »

Hi Karl,

I will look into the resize issue.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Sample of a migrated VO application

Post by Chris »

Hi Karl,

That's strange, I just run the x# version and it's looking good. Try running it through the debugger, do you get an error message?

About the double defines, this is one of the main reasons why we want to start fresh in x# with the SDK from VO and get rid of such problems due to the way the SDK was ported to vulcan. It's the duplicate defines in VOGUIClasses.vh and VOWin32APILibrary.vh that cause the warnings, vulcan reports those warnings as well. Of course you can disable them by using /nowarn:9012,9013

In order to see those defines with the find dialog, you need to make the .vh files part of the project/app, with Add files.

Chris
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
FFF
Posts: 1521
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Sample of a migrated VO application

Post by FFF »

You say, you use the FTP_Explorer.exe as in Wolfgang's zip, start it and resize the form without crash? Strange. For me, "bang"...

Just tried anew from XIDE, same result:
Problemereignisname: CLR20r3
Problemsignatur 01: FTP_Explorer_X_KF.exe
Problemsignatur 02: 1.3.15.0
Problemsignatur 03: 58989cb7
Problemsignatur 04: VulcanRTFuncs
Problemsignatur 05: 4.0.401.0
Problemsignatur 06: 55db3e1f
Problemsignatur 07: 735
Problemsignatur 08: 2f
Problemsignatur 09: Vulcan.Error
Betriebsystemversion: 6.3.9600.2.0.0.256.103
Gebietsschema-ID: 1031
Zusatzinformation 1: 2e9c
Zusatzinformation 2: 2e9c4ccdba018f8bd7c5d1f7f329027a
Zusatzinformation 3: 7e68
Zusatzinformation 4: 7e68d5a5c9af26372a92f667918896e5

Karl
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Sample of a migrated VO application

Post by wriedmann »

Hi Karl,

on resizing it crashes on my system too.... But your error message strangely references .NET 2 (CLR20r3) and not Framework 4.

But I have managed to fix the error. This was the original code:

Code: Select all

method Dispatch( oEV ) 
  local wParam as dword
  local sRect as _winRect

  if oEv:Message == WM_SIZING .and. _oMinimSize != null_object
    sRect := ptr( _cast, oEv:lParam )
Change it to

Code: Select all

method Dispatch( oEV ) 
  local wParam as dword
  local sRect as _winRect
  local oEvent as Event

  if oEv:Message == WM_SIZING .and. _oMinimSize != null_object
    oEvent := oEv
    sRect := ptr( _cast, oEvent:lParam )
and it will work.

Maybe such a cast should be result in a compiler error (try to cast an usual).

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Sample of a migrated VO application

Post by wriedmann »

Hi Karl, hi Chris,

I have now fixed this and a similar issue in another Dispatch() method and uploaded a new archive.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
FFF
Posts: 1521
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Sample of a migrated VO application

Post by FFF »

Wolfgang,
yeah, saw the CLR issue, too. But Xide says, the aef to be V4.0, as are the referenced VN-libs.

Re dispatch: which one, please? I knew i preferered for a reason VO syntax ;)
Found it, replaced and now no crash anymore...
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
FFF
Posts: 1521
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

Sample of a migrated VO application

Post by FFF »

Still no icon file ;(
Regards
Karl
(on Win8.1/64, Xide32 2.19, X#2.19.0.2.)
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Sample of a migrated VO application

Post by Chris »

Hi Wolfgang % Karl,

This problem with casting the lparam to a VOSTRUCT was found and fixed in the compiler just a few days ago, so the code works correctly without changes now. If you guys would like to use the newer compiler build, please let me know and I'll send it to you.

This is (in part) why I was not seeing the error before, but it seems to be also an OS thing, as neither running the original .exe was causing a crash here!

Chris
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Post Reply