Page 1 of 2
AppClass (LIB ) - migrate from VO28SP4 to X#
Posted: Sat Sep 18, 2021 1:46 pm
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
AppClass (LIB ) - migrate from VO28SP4 to X#
Posted: Sat Sep 18, 2021 2:12 pm
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?
AppClass (LIB ) - migrate from VO28SP4 to X#
Posted: Sat Sep 18, 2021 2:38 pm
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.
//-----------------------------------------------------------------------------------------------------------------------
AppClass (LIB ) - migrate from VO28SP4 to X#
Posted: Sat Sep 18, 2021 3:53 pm
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!
AppClass (LIB ) - migrate from VO28SP4 to X#
Posted: Sat Sep 18, 2021 3:58 pm
by JKCanada604
Hi Chris,
I am going back to your videos..
I must have missed something.
Thank you, keep well and,
Cheers, JK
AppClass (LIB ) - migrate from VO28SP4 to X#
Posted: Sat Sep 18, 2021 5:04 pm
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
Please let us know if that works well now!
.
AppClass (LIB ) - migrate from VO28SP4 to X#
Posted: Sat Sep 18, 2021 5:13 pm
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!
AppClass (LIB ) - migrate from VO28SP4 to X#
Posted: Sat Sep 18, 2021 10:21 pm
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!
AppClass (LIB ) - migrate from VO28SP4 to X#
Posted: Tue Sep 21, 2021 6:41 am
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
AppClass (LIB ) - migrate from VO28SP4 to X#
Posted: Tue Sep 21, 2021 7:41 am
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.
.