xsharp.eu • Need Help Porting Vulcan to X#
Page 1 of 2

Need Help Porting Vulcan to X#

Posted: Wed Mar 22, 2017 7:06 pm
by mygnkmail-tech@yahoo.com
Hi, I have a relativity small Vulcan app that I am having trouble porting to X#. I ran the porter and the xxx-XS.Sln file was successfully created. When I open the solution, VS 2015 doesn't display the Start button instead the Attach... button is displayed. I'm not sure how to proceed from here. Also, any form I click on doesn't get loaded by the form editor. Instead a message is displayed:
"To prevent possible data loss before loading the designer, the following errors must be resolved:" and "The designer could not be shown for this file because none of the classes within it can be designed." Followed by a bunch of Show Call Stack errors. Any ideas on what I'm doing wrong?

If it helps, I have attached the project.
Thanks,
Gary

Need Help Porting Vulcan to X#

Posted: Thu Mar 23, 2017 11:36 am
by Chris
Hi Gary,

I confirm the problem, I see the same thing here, too. The xporter must have done something wrong in converting the project, we will look closely into it and will get back to you asap!

Chris

Need Help Porting Vulcan to X#

Posted: Thu Mar 23, 2017 3:10 pm
by mygnkmail-tech@yahoo.com
Hi Chris,
Not a make or break situation for me.
Thanks for looking into it.
Gary

Need Help Porting Vulcan to X#

Posted: Thu Mar 23, 2017 7:33 pm
by Chris
Hi Gary,

From what I see, the problem is that there's a platform identifier missing in the .xsproj file. But simply by loading and closing the solution, the project system of x# fixes this problem, so the next time you open the solution, building/starting the app will be enabled.

When building you will get 2 warnings (which get converted to errors), either disabling this warning (649) by entering its number in the "Project settings/Build/Suppress specific warnings" project options or setting "Warnings As Errors" to False will allow your code to compile and it will run as expected.

I still see the issue opening the form in the designer though. I don't know what is causing this, will check with Robert about it.

Chris

Need Help Porting Vulcan to X#

Posted: Mon Mar 27, 2017 7:07 pm
by mygnkmail-tech@yahoo.com
Hi Chris,

Any luck with the form editor issue?

Thanks,
Gary

Need Help Porting Vulcan to X#

Posted: Mon Mar 27, 2017 7:18 pm
by robert
Gary,

Chris is NOT going to look into this himself.
Visual Studio is really not his thing.
Fabrice and I take care of that.
And I have not found the time to check this yet.
Was too busy with other obligations.
Hopefully tomorrow.

Robert

Need Help Porting Vulcan to X#

Posted: Mon Mar 27, 2017 7:35 pm
by mygnkmail-tech@yahoo.com
Hi Robert,

Using my scale interface program with X# is not a high priority item on my end. I was just experimenting. So, no hurries here.

Thanks,
Gary

Need Help Porting Vulcan to X#

Posted: Mon Mar 27, 2017 10:18 pm
by Chris
Robert,

You are right of course, but actually I did have a look :-)
Problem is the font assignment, looks like the codedom chokes on the System.Drawing.FontStyle.* part. Gary, removing the "font" lines for the designer.prg file will allow the form to load in the designer, but I admit this is not a good solution, so I'd suggest to wait for a fix for this.

Chris

Need Help Porting Vulcan to X#

Posted: Tue Mar 28, 2017 9:24 am
by robert
Gary,

W.r.t. the xporter: it looks like you have used an older version of the XPorter to convert the Vulcan project to X#. The Xporter.exe in the XSharp.Bin folder should convert everything without problems.
After converting the Vulcan project you should be able to compile and run.
I cannot test the code completely, since I do not have the scanner.

You will have to set 'warnings as errors' on the Build page for the project options to false, because there are 2 warnings for generated code.

I noticed that there was still an older version of XPorter in the downloads section on the website. I have removed that copy.

With regard to the form editor the following:
Your example exposed several problems in the code parser for windows forms:
- it fails when the form.prg or form.designer.prg has methods without parameters
- it fails for constructor parameters of type 'enumerator value' such as the font style
- your code uses font sizes in fractions. This fails on a machine with a decimal separator which is not a comma.
- and more

I am still struggling with the form that shows the pie gauge. The others are working fine now.
I will let you know when I have a solution.


Robert

Need Help Porting Vulcan to X#

Posted: Tue Mar 28, 2017 6:00 pm
by robert
Gary,

Now the Gauge also displays as in VO. There was a problem decoding inline assignments for local variables, such as there is in the generated code:

Code: Select all

LOCAL aGaugeLabel2 := System.Windows.Forms.AGaugeLabel{} AS System.Windows.Forms.AGaugeLabel
I will probably create a new build before Cologne.
Please give us some time for testing.

Robert