Porting VO Code
-
- Posts: 114
- Joined: Mon May 02, 2016 9:10 am
- Location: Schweiz
Porting VO Code
Hi Dev Team
I just tried to convert one of our VO-Programs. I was able to correct the most of the errors.
But These two Things does not compile:
Split Window Class:
SELF:Font := Font{,9,"Arial"}
Schweregrad Code Beschreibung Projekt Datei Zeile Unterdrückungszustand
Fehler XS0144 Cannot create an instance of the abstract class or interface 'Font'
SELF:oDefaultIcon := Icon{ ICONSTANDARD }
Schweregrad Code Beschreibung Projekt Datei Zeile Unterdrückungszustand
Fehler XS0144 Cannot create an instance of the abstract class or interface 'Icon'
Any idea how to solve this?
TIA Markus
I just tried to convert one of our VO-Programs. I was able to correct the most of the errors.
But These two Things does not compile:
Split Window Class:
SELF:Font := Font{,9,"Arial"}
Schweregrad Code Beschreibung Projekt Datei Zeile Unterdrückungszustand
Fehler XS0144 Cannot create an instance of the abstract class or interface 'Font'
SELF:oDefaultIcon := Icon{ ICONSTANDARD }
Schweregrad Code Beschreibung Projekt Datei Zeile Unterdrückungszustand
Fehler XS0144 Cannot create an instance of the abstract class or interface 'Icon'
Any idea how to solve this?
TIA Markus
Porting VO Code
Hi Markus,
Those are strange errors..have you created your own Icon and Font class in the code? Maybe in VO you had added additional methods to the already existing Font/Icon classes? Or maybe there is something else causing the problem, can you send the full code of this class so we can have a look?
Chris
Those are strange errors..have you created your own Icon and Font class in the code? Maybe in VO you had added additional methods to the already existing Font/Icon classes? Or maybe there is something else causing the problem, can you send the full code of this class so we can have a look?
Chris
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
-
- Posts: 114
- Joined: Mon May 02, 2016 9:10 am
- Location: Schweiz
Porting VO Code
Hi Chris
thanks for your fast answer. I attached the solution to this post.
I didn't find an own font class in this Project.
HTH and TIA Markus
thanks for your fast answer. I attached the solution to this post.
I didn't find an own font class in this Project.
HTH and TIA Markus
Porting VO Code
Hi Markus,
Thanks for providing the code! The problem is that there's a Font and Icon class defined in the Excel library, which conflicts with the Font and Icon classes in the SDK. There are 2 solutions:
1. Remove the USING Microsoft.Office.Interop.Excel command and supply this namespace when needed, for example change
LOCAL oWorkbooks AS Workbooks
to
LOCAL oWorkbooks AS Microsoft.Office.Interop.Excel.Workbooks
2. Keep the USING Microsoft.Office.Interop.Excel command, but prefix the classes from the SDK with "Vulcan.VO", this is the namespace used by the compiled SDK classes. So for example change
PROTECT oDefaultIcon AS Icon
...
SELF:Font := Font{,9,"Arial"}
...
SELF:oDefaultIcon := Icon{ ICONSTANDARD }
to
PROTECT oDefaultIcon AS Vulcan.VO.Icon
...
SELF:Font := Vulcan.VO.Font{,9,"Arial"}
...
SELF:oDefaultIcon := Vulcan.VO.Icon{ ICONSTANDARD }
Using either way it should compile fine now!
Chris
Thanks for providing the code! The problem is that there's a Font and Icon class defined in the Excel library, which conflicts with the Font and Icon classes in the SDK. There are 2 solutions:
1. Remove the USING Microsoft.Office.Interop.Excel command and supply this namespace when needed, for example change
LOCAL oWorkbooks AS Workbooks
to
LOCAL oWorkbooks AS Microsoft.Office.Interop.Excel.Workbooks
2. Keep the USING Microsoft.Office.Interop.Excel command, but prefix the classes from the SDK with "Vulcan.VO", this is the namespace used by the compiled SDK classes. So for example change
PROTECT oDefaultIcon AS Icon
...
SELF:Font := Font{,9,"Arial"}
...
SELF:oDefaultIcon := Icon{ ICONSTANDARD }
to
PROTECT oDefaultIcon AS Vulcan.VO.Icon
...
SELF:Font := Vulcan.VO.Font{,9,"Arial"}
...
SELF:oDefaultIcon := Vulcan.VO.Icon{ ICONSTANDARD }
Using either way it should compile fine now!
Chris
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Porting VO Code
Chris,
Maybe one more addition to your comment about prefixing classes with namespaces.
We now also have the ability to define an alias for a namespace. So you can write:
This allows you to simplify the namespace in your code. Instead of
you can then write
Robert
Maybe one more addition to your comment about prefixing classes with namespaces.
We now also have the ability to define an alias for a namespace. So you can write:
Code: Select all
USING Excel := Microsoft.Office.Interop.Excel
Code: Select all
LOCAL oWorkbooks AS Microsoft.Office.Interop.Excel.Workbooks
Code: Select all
LOCAL oWorkbooks AS Excel.Workbooks
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
-
- Posts: 114
- Joined: Mon May 02, 2016 9:10 am
- Location: Schweiz
Porting VO Code
Hi Chris, hi Robert
first of all I have to thank for your really fast Responses!
It's a pleasure to work this way.
With These fixes I can compile the solution without Errors. Unfortunately the app crashes on the instantiation of the TreeView object. I commented out the try/catch in the start.prg to get more Details about the error but have no idea whats the reason for the Crash.
Thanks Markus
first of all I have to thank for your really fast Responses!
It's a pleasure to work this way.
With These fixes I can compile the solution without Errors. Unfortunately the app crashes on the instantiation of the TreeView object. I commented out the try/catch in the start.prg to get more Details about the error but have no idea whats the reason for the Crash.
Thanks Markus
Porting VO Code
Hi Markus,
just a shot in the dark: do you have the cato*.dll files in the application directory? AFAIK the TreeView needs them too.
Wolfgang
P.S. I'm have successfully transported the FTPExplorer to X#, so the ListView/TreeView/SplitWindow work in X#.
just a shot in the dark: do you have the cato*.dll files in the application directory? AFAIK the TreeView needs them too.
Wolfgang
P.S. I'm have successfully transported the FTPExplorer to X#, so the ListView/TreeView/SplitWindow work in X#.
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Porting VO Code
Markus,
Was this really an app that ran in VO this way or did you copy and paste some code from different VO apps and combine this in the X# app ?
The Treeview and Listview class need a Point and Dimension argument to work properly.
In your MyTreeView class change:
to
and in your clas IMSListView make the following change:
I could not completely test your app because I am missing the resources, and I have the impression that not all the code is there.
The Drive array is missing some array elements I think, and element # 2 in each row is not numeric as it is supposed to be.
Robert
Was this really an app that ran in VO this way or did you copy and paste some code from different VO apps and combine this in the X# app ?
The Treeview and Listview class need a Point and Dimension argument to work properly.
In your MyTreeView class change:
Code: Select all
SUPER(arg1,arg2)
Code: Select all
SUPER(arg1,arg2,Point{}, Dimension{})
Code: Select all
CONSTRUCTOR(oOwner, nId, oPoint, oDim, kStyle)
SUPER(oOwner, nId, oPoint, oDim, kStyle)
Code: Select all
CONSTRUCTOR(oOwner, nId, oPoint, oDim, kStyle)
IF IsNil(oPoint)
oPoint := Point{}
ENDIF
IF IsNil(oDim)
oDim := Dimension{}
ENDIF
SUPER(oOwner, nId, oPoint, oDim, kStyle)
The Drive array is missing some array elements I think, and element # 2 in each row is not numeric as it is supposed to be.
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
Porting VO Code
Hi Markus,
In addition to what Wolfgang and Robert said, if the app still doesn't run without errors, can you please send also the VO .aef file so we can try porting it also in our machines?
thanks,
Chris
In addition to what Wolfgang and Robert said, if the app still doesn't run without errors, can you please send also the VO .aef file so we can try porting it also in our machines?
thanks,
Chris
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
-
- Posts: 114
- Joined: Mon May 02, 2016 9:10 am
- Location: Schweiz
Porting VO Code
Hi Chris
here is the aef which works well in VO 2.8.
The program is just a sample which I want to use in our next VO Usergroup Meeting to demonstrate the way from VO to X#.
Markus
Attn. Robert: The error with the ListView was my fault as I tried different Things and did a copy&paste mistake.
here is the aef which works well in VO 2.8.
The program is just a sample which I want to use in our next VO Usergroup Meeting to demonstrate the way from VO to X#.
Markus
Attn. Robert: The error with the ListView was my fault as I tried different Things and did a copy&paste mistake.