Welcome, Guest
Username: Password: Remember me
Visual Objects

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

TOPIC:

Existing VO project conversion 27 Sep 2016 17:19 #342

  • richpilks
  • richpilks's Avatar
  • Topic Author


  • Posts: 5
  • Firstly well done to the team for what you have achieved in just one year.

    Can you tell me how to go about getting an existing VO (2.7) project into xSharp. I do not mind doing all required coding changes, it will give me a chance to learn X# while I am at it. I am just not sure where to start.

    Regards
    Richard

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

    Existing VO project conversion 27 Sep 2016 20:38 #343

    • robert
    • robert's Avatar


  • Posts: 3585
  • Richard,

    We do not have a tool at this moment to automate this for you.
    Fabrice is working on an AEF to VS Project converter.
    If you do not want to wait for this, then this is what I would recommend:

    - Create an empty .Net project
    - If you want to use xBase types such as ARRAY and USUAL you need to set the Dialect to VO or Vulcan and add references to the Vulcan Runtime DLLs
    - Export the source in your VO project to PRG files (if I am correct you should be able to right click the modules list in an app and export to PRG)
    - Copy the PRG files to your VS project folder
    - Choose 'Add Existing Item' and add all the PRG files to your project
    Rearrange the code in your prg files:
    x Add a line 'END CLASS' to each class declaration
    x Move the methods inside the CLASS ... END CLASS and remove the 'CLASS <MyClass>' from the method declaration
    x Change METHOD Init() to CONSTRUCTOR() and Method AxitIO to DESTRUCTOR()
    x When you use 'Late Bound' code you must set the 'Allow Late Binding' compiler option
    x You may have to set other VO Compatibility options

    Robert
    XSharp Development Team
    The Netherlands

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

    Existing VO project conversion 28 Sep 2016 18:40 #348

    • jpmaertens
    • jpmaertens's Avatar



    Hi Robert,

    Today I converted a small program to work in X#. After some work everything compiled without errors. Documentation is a bit of a problem... but with the helpfile of Vulcan I managed.

    The program runs until I try to open a file then I get :

    Vulcan.NET Runtime Error

    Error Code: 1 [Argument error]
    Error Subcode: 1015 [RDD not found]
    Subsystem: DBCMD
    Function: INIT
    Argument 3: rddName
    Argument(s):
    1: "AXDBFCDX" (STRING)


    Guess I will have to wait until the ADS RDD's for X# are available...

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

    Existing VO project conversion 28 Sep 2016 19:58 #351

    • robert
    • robert's Avatar


  • Posts: 3585
  • JP,
    Did you convert the program from Vulcan ?
    How did you 'initialize' the Advantage RDD inside Vulcan?
    Inside X# you should do the same.

    Robert
    XSharp Development Team
    The Netherlands

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

    Existing VO project conversion 28 Sep 2016 21:56 #353

    • jpmaertens
    • jpmaertens's Avatar



    Hi Robert,

    I bought and installed Vulcan but it was less productive for me than VO. The VO repository is sometimes a pain, but most of the time it is a great help to keep everything organised. Now I am retired and the time pressure is gone, I only kept one (big) project to keep me a bit busy :-) So the temptation is to convert this huge program to X#.

    To answer your question : I did nothing in Vulcan with the ADS RDD's and it would be interesting to know how to "initialise them" in X# to make it work.

    I converted the VO software that comes with ADS to X# everything compiled ok and I can connect to the database without problems. Opening the files did not work.

    groetjes,
    JP

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

    Existing VO project conversion 28 Sep 2016 22:47 #356

    • robert
    • robert's Avatar


  • Posts: 3585
  • JP
    I will create a small sample tomorrow to show how to use ADS in Vulcan and X#

    Robert
    XSharp Development Team
    The Netherlands

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

    Existing VO project conversion 29 Sep 2016 09:02 #361

    • robert
    • robert's Avatar


  • Posts: 3585
  • JP,

    Please have a look at: devzone.advantagedatabase.com/forum/upfi...gStartedVOVulcan.pdf

    To summarize:
    You must load the RDD assembly using Assembly.Load
    You either set the default RDD using RddSetDefault("Advantage.AXDBFCDX")
    Or you prefix the RDD name with "Advantage." in your code

    The reason for this is that for VO the RDD name was the file name. In DotNet the name of the RDD is the classname. You either pass the complete classname (NamespaceName.ClassName) or as an alternative you can tell the runtime (before opening any files) which type should match with RDD name with the following code:

    VODBRegisterRDD("AXDBFCDX", Typeof(Advantage.AXDBFCDX))

    This is what the Vulcan Runtime does for the built-in RDDs, which are located in VulcanRDD.DLL, VulcanDBFCDX.DLL and VulcanDBFFPT.DLL

    Robert
    XSharp Development Team
    The Netherlands

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

    Last edit: by robert.

    Existing VO project conversion 29 Sep 2016 15:33 #367

    • jpmaertens
    • jpmaertens's Avatar



    Hi Robert,

    Thank you for your prompt reaction. I have been trying for several hours now.

    I read the documentation, but ran into trouble very quickly. Have tried all your said, and all kind of things, like downloading the latest AdvantageRDD.dll... according to ADS it should be CLR version 4.0, although when I put it in the GAC, it is only visible as a CLR 2.0 (and showing the correct file version info : 11.10.0.30), don't think that is the problem though.

    Because I could not send this as an attachment, I give you a link to a screenshot www.artemens.be/images/screenshot.jpg

    greetings,
    JP

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

    Existing VO project conversion 29 Sep 2016 15:43 #368

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3366
  • Hi JP, hi Robert,

    PMFJI,

    unfortunately there is NO ADS RDD for Vulcan.NET 4 and .NET 4. It seems to be an error by the new SAP development team in India.

    Steve F. has decompiled the RDD with Jetbrains Dotpeek decmopiler and recompiled it.

    Therefore I have a working RDD.

    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

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

    Existing VO project conversion 29 Sep 2016 15:56 #369

    • robert
    • robert's Avatar


  • Posts: 3585
  • JP,

    Some remarks on your screenshot:
    - Your project inside XIDE looks like a Vulcan.NET project to me. The compiler errors all start with "VN".

    - It looks like the Advantage RDD is linked against .Net Framework 2.0. It references VulcanRT 1.1.401 which is the Vulcan assembly for CLR 2

    - If you have a reference to an assembly (which you have) and you have used something from an assembly (like you did because you were using Typeof) then you do not need to do Assembly.Load()

    I think this should work if you change the projects in XIDE to work against .Net framework 2.0.
    And you can remove the Assembvly.Load as well.

    If you want to work with Advantage and .NET 4, you need a .NET 4 compatible version of the Assembly. That is something you need to get from SAP or create yourself, like Wolfgang described.

    Robert
    XSharp Development Team
    The Netherlands

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

    Existing VO project conversion 29 Sep 2016 17:02 #370

    • richpilks
    • richpilks's Avatar
    • Topic Author


  • Posts: 5
  • Hi Robert

    I was traveling so could not reply sooner.

    Thank you for the guide on how to do it manually, I will be getting on to that now.

    Two specific questions:
    1. Since we are now in .net with this can I use any .net mysql connector to connect to a mysql server for database access? I had to use ODBC before.
    2. if you have a window resource that was created in the VO designer, does x# make use of that or do we have to redo the window designs? (could we change it in VO and copy back to X#)?

    Thanks for your efforts and assistance you are giving us.

    Regards
    Richard

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

    Existing VO project conversion 29 Sep 2016 17:16 #371

    • Chris
    • Chris's Avatar


  • Posts: 3973
  • Hi JP!

    As Robert said, you are indeed compiling with the vulcan compiler (XIDE can compile x#, vulcan and c# apps). Please check the Project window, next to your app and libraries there's a "-VN" sign, saying that this is a vulcan app. It's easy to change it, through Application/Properties/General, change "Language" to x# and "Dialect" to "<vulcan>". But I'd suggest leaving it as at is for now, let's debug this step by step.

    The first error you get, is due to a copy/paste clipboard error, see the signs surrounding "AdvantageRDD" in the red line, they are special characters, not normal double quotes. Replace those with double quotes (") and this error will go away.

    The rest of the errors mean that the advantage RDD can not be loaded, because it is compiled against a different version of the vulcan runtime (401) than the one that you have. I assume you are using vulcan 3, or maybe one of the public trial versions? Which build exactly? You need to use the advantage RDD that was released specifically for the vulcan build that you are using, this is the main problem. I am sure you can find older versions of the advantage dlls in the ADS website. And I think you can also find CLR 4 dlls for older vulcan builds, at least I think I remember when I was part of the vulcan dev team, the ADS guys were releasing both CLR2 and CLR4 dlls separately.

    hth,
    Chris
    XSharp Development Team
    chris(at)xsharp.eu

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

    Existing VO project conversion 29 Sep 2016 18:08 #372

    • robert
    • robert's Avatar


  • Posts: 3585
  • Richard,

    1) Yes you can use any .NET datasource to connect to data. I would recommend you do that in stead of using the 'Old' SQL classes and ODBC.

    2) If you mean 'VO Windows Binary' with resources, then the answer is Yes. X# will be able to use these and generate the source for the windows. Of course the windows will still be 'VO GUI' windows and will not be true Windows Forms or WPF windows.
    Paul Piko has a tool, called FaceLift, that will read the Windows BInaries and will allow you to convert these to Windows Forms ( www.vulcanmindmeld.net/ ).
    Since the object model and events are different you will still have to manually port the events such as EditFocusChange and EditChange.

    Robert
    XSharp Development Team
    The Netherlands

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

    Existing VO project conversion 29 Sep 2016 18:15 #373

    • richpilks
    • richpilks's Avatar
    • Topic Author


  • Posts: 5
  • Robert

    Thanks for those tips. In the long run it would be better to move away from the VO GUI so I will look into Pauls tool for porting and get into Windows forms or WPF windows.

    Thanks

    Richard

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

    • Page:
    • 1