vulcan_to_xsharp
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
vulcan_to_xsharp [2018/02/01 16:40] – created wikiadmin | vulcan_to_xsharp [2018/02/01 23:39] (current) – dickvankooten | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Migrate from Vulcan.NET to X# ====== | + | ====== Migrate |
+ | |||
+ | This chapter contains the steps you must take to have an existing Vulcan run in X# with the least amount of work. You may not need to do all steps, and the few errors I got and solved you may not see at all, while some others errors may occur in your project. But in general, if you are aware of what is described below, the Vulcan to X# conversion can be done very quickly. | ||
+ | |||
+ | The X# documentation says: | ||
+ | |||
+ | VO and Vulcan support is available in this build of XSharp through what we call the Bring Your Own Runtime principle. | ||
+ | |||
+ | If you own a license of Vulcan, you can copy the DLLs that you find in the < | ||
+ | Then add references to the DLLs that you need in your project. | ||
+ | |||
+ | In this example, we set up an existing Vulcan WPF project into X#. | ||
+ | |||
+ | **Step 1 Creating a new project, and fix name and directory problems** | ||
+ | |||
+ | In Visual Studio, choose File/ | ||
+ | |||
+ | Default it says: WpfApplication1, | ||
+ | |||
+ | This has 2 consequences (which is a Visual Studio flaw in my opinion) | ||
+ | |||
+ | 1) The sln is created under D: | ||
+ | 2 My prg and XAML files are called WPFWindow1.xaml.prg. Why does VS not call this ' | ||
+ | <Window x: | ||
+ | |||
+ | A better solution is: | ||
+ | 1) Uncheck the box Create directory for solution. This saves you one level of directories. | ||
+ | 2) Directly delete the WPF window. Then create a new one via the projects right mouse option Add/New Item, and add a WPF windows with the desired name. | ||
+ | |||
+ | |||
+ | If, in the end, your program doesn' | ||
+ | |||
+ | This comes from a file called App.g.prg, in the Debug directory, and this may still show: | ||
+ | |||
+ | SELF: | ||
+ | |||
+ | Change the bold part to the name you gave the new WPF window and the program will work. | ||
+ | |||
+ | **Step 2: copy existing Vulcan files (like .prg' | ||
+ | |||
+ | Just copy the WPF window XAML **code** in the editor from your Vulcan project into iConnectMailReader.xaml Xaml code. You can do (almost) the same for the code in iConnectMailReader.xaml.prg. I think X# needs PUBLIC Constructor while Vulcan uses Constructor. | ||
+ | If you have more .prg (or other files) in Vulcan, just copy them to the same directory where you have the Mainwindow files. In the Solution Explorer, select the project, then right mouse Add/ | ||
+ | |||
+ | **Step 3: Change some project settings** | ||
+ | |||
+ | Right mouse click Properties on the project. In the General tab, change Dialect to Vulcan.NET | ||
+ | |||
+ | |||
+ | {{:: | ||
+ | |||
+ | In the **Language** tab (see left, same screen), I keep everything on False except | ||
+ | Implicit signed/ | ||
+ | Treat missing types as USUAL : true | ||
+ | Enable Implicit Namespace lookup: true (Reason: see error below) | ||
+ | Allow Unsafe Code: maybe true (Reason: see error below) | ||
+ | |||
+ | In the **Build** tab, I change Any CPU to X86. Prefer 32 bits changes to false then. | ||
+ | |||
+ | **Step 4: Set references** | ||
+ | |||
+ | Should you compile your product now, you will get a run time error: | ||
+ | |||
+ | |||
+ | Error XS9014 The dialect ' | ||
+ | |||
+ | On the project, go via Right Mouse menu to Add/ | ||
+ | |||
+ | C:\Program Files (x86)\Vulcan.NET 3.0\Redist\Assemblies\v4.0 | ||
+ | |||
+ | Note that version 4 does not have different Vulcan DLL's so you can also choose C:\Program Files (x86)\Vulcan.NET 4.0\Redist\Assemblies\v4.0 | ||
+ | |||
+ | |||
+ | The X# help file says: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | DLLs you MUST add if you compile for the VO/Vulcan dialect: | ||
+ | |||
+ | |||
+ | ·VulcanRT.DLL | ||
+ | |||
+ | ·VulcanRTFuncs.DLL | ||
+ | |||
+ | These 2 files are NEVER added to your Vulcan projects, Vulcan adds a reference to these DLLs automatically. XSharp does not do that, so you should add them yourself. | ||
+ | |||
+ | DLLs that you MAY want to add, depending on what you are using in your application: | ||
+ | |||
+ | ·VulcanVOSystemClasses.dll | ||
+ | ·VulcanVORDDClasses.dll | ||
+ | ·VulcanVOGUIClasses.dll | ||
+ | ·VulcanVOInternetClasses.dll | ||
+ | ·VulcanVOSQLClasses.dll | ||
+ | ·VulcanVOConsoleClasses.dll | ||
+ | ·VulcanVOWin32APILibrary.dll | ||
+ | |||
+ | ---- | ||
+ | |||
+ | E.g. you would need the VulcanVORDDClasses.dll of you are going to use DBF files. You won't need VulcanVOGUIClasses.dll if you are using WPF/ | ||
+ | |||
+ | **Other projects** | ||
+ | |||
+ | I also had a C# project included. Go to the solution, Right mouse menu, Add Existing Project and point to the .csproj files; these show on the same level in the solution explorer with every included file, references etc. After that, on the project: Right Mouse menu to Add/ | ||
+ | |||
+ | **Other references** | ||
+ | |||
+ | For ADS you can download several RDDs, e.g.: | ||
+ | |||
+ | http:// | ||
+ | |||
+ | http:// | ||
+ | |||
+ | It must match your VulcanRT.DLL | ||
+ | |||
+ | I included AdvantageRDD.dll 11.10.0.20 with my Vulcan version 3 DLL's. For external library Chilkat I use ChilkatDotNet45.dll 9.5.0.56. I place them in the same directory as the .sln file and then include it using Add/ | ||
+ | |||
+ | I was left with one more **errors**: | ||
+ | |||
+ | **Error** XS0246The type or namespace name ' | ||
+ | |||
+ | **Solution** A reference to to VulcanVORDDClasses.dll was present however. This was solved by | ||
+ | Project settings, the Language page and enable the option " | ||
+ | |||
+ | One **error** then remained: | ||
+ | |||
+ | Error XS0012 The type ' | ||
+ | |||
+ | **Solution: | ||
+ | |||
+ | **Step 5: solving other errors** | ||
+ | |||
+ | If you have a working Vulcan project, you may come across errors you did not have in Vulcan because the X# compiler is more strict. Some examples: | ||
+ | |||
+ | **Error **XS0127 Since ' | ||
+ | |||
+ | **Solution**: | ||
+ | |||
+ | |||
+ | **Error **XS0029 Cannot implicitly convert type ' | ||
+ | |||
+ | **Solution**: | ||
+ | |||
+ | |||
+ | **Error**: Severity Code Description Project File Line Suppression State | ||
+ | Error XS0214 Pointers and fixed size buffers may only be used in an unsafe context iConnectMailReader D: | ||
+ | |||
+ | **Solution**: | ||
+ | |||
+ | **Error** | ||
+ | |||
+ | warning MSB3270: There was a mismatch between the processor architecture of the project being built " | ||
+ | |||
+ | **Solution**: | ||
+ | |||
+ | |||
+ | After this, the project compiled and worked as it did in Vulcan 8-) | ||
+ | |||
+ | Dick van Kooten | ||
vulcan_to_xsharp.txt · Last modified: 2018/02/01 23:39 by dickvankooten