Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC:

AppClass (LIB ) - migrate from VO28SP4 to X# 18 Sep 2021 15:46 #19628

  • JKCanada604
  • JKCanada604's Avatar
  • Topic Author


  • Posts: 48
  • 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

    Please Log in or Create an account to join the conversation.

    AppClass (LIB ) - migrate from VO28SP4 to X# 18 Sep 2021 16:12 #19629

    • Chris
    • Chris's Avatar


  • Posts: 3980
  • 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:




    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?
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    AppClass (LIB ) - migrate from VO28SP4 to X# 18 Sep 2021 16:38 #19631

    • JKCanada604
    • JKCanada604's Avatar
    • Topic Author


  • Posts: 48
  • 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.
    //

    Please Log in or Create an account to join the conversation.

    AppClass (LIB ) - migrate from VO28SP4 to X# 18 Sep 2021 17:53 #19632

    • JKCanada604
    • JKCanada604's Avatar
    • Topic Author


  • Posts: 48
  • 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!

    Please Log in or Create an account to join the conversation.

    AppClass (LIB ) - migrate from VO28SP4 to X# 18 Sep 2021 17:58 #19633

    • JKCanada604
    • JKCanada604's Avatar
    • Topic Author


  • Posts: 48
  • Hi Chris,

    I am going back to your videos..

    I must have missed something.

    Thank you, keep well and,

    Cheers, JK

    Please Log in or Create an account to join the conversation.

    AppClass (LIB ) - migrate from VO28SP4 to X# 18 Sep 2021 19:04 #19634

    • Chris
    • Chris's Avatar


  • Posts: 3980
  • 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

    METHOD __Gather() AS LOGIC STRICT

    Please let us know if that works well now!

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Last edit: by Chris.

    AppClass (LIB ) - migrate from VO28SP4 to X# 18 Sep 2021 19:13 #19635

    • JKCanada604
    • JKCanada604's Avatar
    • Topic Author


  • Posts: 48
  • 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!

    Please Log in or Create an account to join the conversation.

    AppClass (LIB ) - migrate from VO28SP4 to X# 19 Sep 2021 00:21 #19637

    • Chris
    • Chris's Avatar


  • Posts: 3980
  • Hi John,

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

    METHOD __Scatter() AS Control STRICT

    so you need to use the same in your subclass!
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Last edit: by Chris.

    AppClass (LIB ) - migrate from VO28SP4 to X# 21 Sep 2021 08:41 #19656

    • JKCanada604
    • JKCanada604's Avatar
    • Topic Author


  • Posts: 48
  • 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:

    Please Log in or Create an account to join the conversation.

    AppClass (LIB ) - migrate from VO28SP4 to X# 21 Sep 2021 09:41 #19657

    • Chris
    • Chris's Avatar


  • Posts: 3980
  • 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.

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    AppClass (LIB ) - migrate from VO28SP4 to X# 21 Sep 2021 09:52 #19658

    • JKCanada604
    • JKCanada604's Avatar
    • Topic Author


  • Posts: 48
  • Hi Chris,

    I have sent the 7z file to you directly.

    Thank you, keep well and,

    Cheers, JK

    Please Log in or Create an account to join the conversation.

    AppClass (LIB ) - migrate from VO28SP4 to X# 21 Sep 2021 10:23 #19659

    • Chris
    • Chris's Avatar


  • Posts: 3980
  • Hi John,

    Thanks for the file! I see the problem, it's a bug in the compiler, it fails because of the multiple declarations of the PRIVATE:

    PRIVATE &cVarName

    in the function VOSExecute(). Nothing wrong with your code, it's just a compiler problem, I will open a report for Robert to fix this, probably in the coming build. Until this is fixed, you can use a temp workaround, replace the above PRIVATE declarations with this:

    __MemVarDecl(cVarName, true)

    You will need to make this change in 5 places in this function and then the code will compile without errors! After the compiler fix is released, the you can restore back your previous code with PRIVATE &cVarName
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    AppClass (LIB ) - migrate from VO28SP4 to X# 21 Sep 2021 10:30 #19660

    • KeesIC2
    • KeesIC2's Avatar


  • Posts: 49
  • JKCanada604 wrote: 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!


    Which video is this exactly? Thanks.

    Please Log in or Create an account to join the conversation.

    AppClass (LIB ) - migrate from VO28SP4 to X# 21 Sep 2021 10:58 #19661

    • Chris
    • Chris's Avatar


  • Posts: 3980
  • XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1