Existing VO project conversion

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
richpilks
Posts: 5
Joined: Mon Feb 29, 2016 3:29 pm

Existing VO project conversion

Post by richpilks »

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
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Existing VO project conversion

Post by robert »

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
robert@xsharp.eu
jpmaertens

Existing VO project conversion

Post by jpmaertens »

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...
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Existing VO project conversion

Post by robert »

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
robert@xsharp.eu
jpmaertens

Existing VO project conversion

Post by jpmaertens »

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
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Existing VO project conversion

Post by robert »

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

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Existing VO project conversion

Post by robert »

JP,

Please have a look at: http://devzone.advantagedatabase.com/forum/upfiles/GettingStartedVOVulcan.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
robert@xsharp.eu
jpmaertens

Existing VO project conversion

Post by jpmaertens »

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 http://www.artemens.be/images/screenshot.jpg

greetings,
JP
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Existing VO project conversion

Post by wriedmann »

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
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Existing VO project conversion

Post by robert »

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
robert@xsharp.eu
Post Reply