AppClass (LIB ) - migrate from VO28SP4 to X#

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
JKCanada604
Posts: 48
Joined: Wed Aug 11, 2021 11:03 am

AppClass (LIB ) - migrate from VO28SP4 to X#

Post by JKCanada604 »

Good day to you all,

I am working towards porting a large application to X# from VO28SP4.

Everything in VO is working however, bringing this code into X# throws all kinds of errors mostly due to the class inheritance that it uses.

Has anyone accomplished this task or, alternatively have any suggestions for me?

As always, thank you, keep well and,

Cheers, JK
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

AppClass (LIB ) - migrate from VO28SP4 to X#

Post by Chris »

Hi JK,

Yes, a lot of applications have been ported already from X# to VO, but depending on what the original code is using and how it's structured, this porting process can take some time, especially if you are new to the world of .Net and/or X#. First of all, please open the X# help file and read all the topics under "Migrating apps from VO to X#", as it contains very important and valuable information about porting VO code. Also please do view those 2 online sessions about the same subject, with hands-on samples of the porting process:

https://www.youtube.com/watch?v=yduay2fc-nE
https://www.youtube.com/watch?v=A-zhcsYuas8

It will be very helful to view all the above in order to be better prepared for porting your code!

As for the (first) problem itself you are facing, if the above does not directly give the answer, can you please give us some more information? What are the exact errors you are getting, and what is the structure/class inheritance of your code in VO?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
JKCanada604
Posts: 48
Joined: Wed Aug 11, 2021 11:03 am

AppClass (LIB ) - migrate from VO28SP4 to X#

Post by JKCanada604 »

Hi Chris!

Thank you for the very prompt reply! – wow.

Yes, I have watched the videos and they have been most helpful.

The issue I am having relates to augmenting the VO classes.

I have tried the “extension’ process however, it appears that I require access to members so, that did not work.

Ergo, I am trying to inherit from something like the Checkbox class and am having trouble.

As always, thank you, keep well and,

Cheers, JK


//-----------------------------------------------------------------------------------------------------------------------
John Kniewasser – IT Officer – Island Tug and Barge Ltd.
//-----------------------------------------------------------------------------------------------------------------------
JKCanada604
Posts: 48
Joined: Wed Aug 11, 2021 11:03 am

AppClass (LIB ) - migrate from VO28SP4 to X#

Post by JKCanada604 »

Hi once again!

Here is the error message:

XS9042 Override of virtual method '__Gather' in child class has CLIPPER calling convention but overridden method in parent class is STRICT

Thank you!
JKCanada604
Posts: 48
Joined: Wed Aug 11, 2021 11:03 am

AppClass (LIB ) - migrate from VO28SP4 to X#

Post by JKCanada604 »

Hi Chris,

I am going back to your videos..

I must have missed something.

Thank you, keep well and,

Cheers, JK
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

AppClass (LIB ) - migrate from VO28SP4 to X#

Post by Chris »

Hi John,

JKCanada604 wrote: XS9042 Override of virtual method '__Gather' in child class has CLIPPER calling convention but overridden method in parent class is STRICT
Ah, OK, fortunately that's an easy one! It's as the message says, the __Gather() method is declared as STRICT in the SDK classes, so your method needs to be declared as such, too. You did not show your code, but I assume you are overriding the __Gather() method of either Control or the DataWindow class, in which case for both of them you need to declare your method as

Code: Select all

METHOD __Gather() AS LOGIC STRICT
Please let us know if that works well now!

.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
JKCanada604
Posts: 48
Joined: Wed Aug 11, 2021 11:03 am

AppClass (LIB ) - migrate from VO28SP4 to X#

Post by JKCanada604 »

Hi Chris,

Fantastic!

Now I have to match the return types!

XS0508 'AppCheck.__Scatter()': return type must be 'VO.Control' to match overridden member

I am returning Self...

Again, thank you!
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

AppClass (LIB ) - migrate from VO28SP4 to X#

Post by Chris »

Hi John,

Yeah, the definition of the __Scatter() method of the Control class is:

Code: Select all

METHOD __Scatter() AS Control STRICT
so you need to use the same in your subclass!
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
JKCanada604
Posts: 48
Joined: Wed Aug 11, 2021 11:03 am

AppClass (LIB ) - migrate from VO28SP4 to X#

Post by JKCanada604 »

Hi Chris!

Thank you for your great videos!

I really like one of the tricks that you showed us creating a local variable within a method to hold a class so that it can be executed right from the local rather than hunting up the object's methods.. very crafty!

I am having a battle with XS9999 - "An item with the same key has already been added..."

I have tried the NAMESPACE trick in the class however, I think I just do not know enough as to how and when to use it...

It hits on a line like this:

STATIC GLOBAL cScriptName AS STRING

Just in case you have a moment I have attaching ..

All hints appreciated...

Again, always, thank you, keep well and,

Cheers, JK
Attachments
VOScript-X.7z
(2.09 KiB) Downloaded 30 times
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

AppClass (LIB ) - migrate from VO28SP4 to X#

Post by Chris »

Hi John,

Glad you found the videos useful!

The problem you are having looks like a compiler bug, but unfortunately the sample you sent is not complete.
Can you please zip the whole folder of the app and post it? You can also send it directly to me if you prefer.

.
Chris Pyrgas

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