fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Conversion or application of well known VO libraries to X#

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #1

We are working on the conversion of 1 large client project from VO to X#. We have converted 1 program which uses a lot of 'general' functionality and this seems to be a good base to start converting the larger projects.

In the program we use the following VO libs. My questions is:

1 Did anyone convert any of these libs, willing to share the X# converted lib?
2 Or is there another strategy to get the functionality of any of these libs in X#? E.g. running Report Pro reports using a VO program?

I realize well that there are better solutions in .Net for at least some of the below libs but apart from info from others how they replaced one or more of these libs, I would like to start wherever possible with converted libs to see if the program still works, and replace with .Net solutions as a second step.

The libs are:
Hoverbutton
Excel automation base class
Word base class

RP2RDD32 Lib
_SE UI XP Base classes (Sven Ebert's toolbar program)

Fab Paint lib
Fab Paintlib control


Dick

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

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #2

Hi Dick,
about FabPaint, I suggest you start with the Vulcan version of that library : It is available at www.fabtoys.net ; and moving to X# should not raise some complex errors.
Sorry, I currently have little time to dedicate to that task, but I would be happy to publish your X# version when it's done.

Fab

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

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #3

Dick,
There is really no need to convert Excel or Word ole classes. Simply add a reference to the Excel and Word interop assemblies and choose "embed interop types" for these references. That will include the type information from these type libraries in your code, so you even don't have to include the assemblies with your app.
And for ReportPro you should use the RP2 version that we have created. Mail me a proof of purchase for RP2 and I will grant you download rights to the RP2 binaries. If you also have a RP2 source lincense I will grant you the rights to the RP2 source as well.

Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

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

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #4

Hello Fabrice,

We're now on 90 errors - after setting the program to Allow Unsafe code, because of the use of pointers.

This is one error we get often:

Warning XS9032 This entity type cannot return a value. Return value ignored. Fab_Ctrl D:\XSharpProjects\FabPaintlibsXsharp\Fab_Ctrl\Bitmap Button.prg 527

XS9032 is skipped in the help file. THis is the code:

ASSIGN ImageList( oNew AS ImageList )
SELF:_oImgList := oNew
SELF:Update()
RETURN SELF:_oImgList

What's wrong with it?

Same question for error XS0108 which is also skipped in the help:

Warning XS0108 'MultiImageWindow.Close()' hides inherited member 'StdImageWindow.Close()'. Use the new keyword if hiding was intended. Fab_PaintLib_Test D:\XSharpProjects\FabPaintlibsXsharp\Fab_PaintLib_Test\Wnd MultiImgView.prg 11

METHOD Close()
//
SUPER:Close()
//
SELF:oMulti:Destroy()
//
return self

If I know what to do here I think we may have a working X# FabPaintLib soon.

Dick

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

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #5

Hi Dick,

About the first warning, it is simple, as its message says, ASSIGNs in .Net do not return values, so the RETURN <xxxx> line is being ignored. You can either chose to remove the code after each RETURN, or simply ignore the warning and disable it.

About the second one, by default METHODs in .Net are not VIRTUAL, meaning that you cannot override a method of a base class by redefining it in a child class, like we do in VO, this instead creates a completely new method, from the CLR's point of view. In order to make a (base) method overrideable, you must explicitly mark it with the VIRTUAL keyword. Or, you van simply enable the "All instance methods virtual" project option, which tells the compiler to make all methods VIRTUAL by default, for compatibility with VO. Both ways should get rid of the warning (which in this case it is important to resolve it, do not simply disable it).

Chris
XSharp Development Team
chris(at)xsharp.eu

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

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #6

Hello Chris,

Do you ever sleep ;)

About the Assign: it's that simple; I actually didn't realize it didn't need the return value to work and thought I had to work out an alternative for Assign. E.g. there's some code saying:
if self:oImg:GetBackgroundColor( @RGB )
return oColor
endif
which seems to imply that the return value has some actual use.

The VIRTUAL solution I have to check after solving missing assembly errors. After removing the Returns I still get 90 errors but the "virtual errors" currently disappeared.

May I suggest to paste the above clear replies in the help file (as these errors are currently undocumented)?

Dick

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

Last edit: by ic2.

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #7

Hi DIck,

ic2 wrote: Do you ever sleep ;)


Yes of course, during the day, when being awake while having constantly over 35C is a waste of time :)

About the return value in ASSIGNs, in VO you could use something like:
CLASS TestClass
ASSIGN TestAssign(n) CLASS TestClass
RETURN n * 2

FUNCTION Start() AS VOID
LOCAL o AS TestClass
LOCAL n AS INT
o := TestClass{}
n := o:TestAssign := 1
? n // prints 2 in VO

so you could indeed use the return value of an assign. I don't think this was good, it could easily make the code impossible to understand and anyway it's not supported in .Net (returning a value from ASSIGN), so it is ignored by the compiler and a warning is reported.

About the documentation, problem is that in the docs we need to use more formal language, while explaining stuff here in the forum in a more casual way is a lot easier. But if Robert thinks it's good enough, he will include the explanation to the docs.

Chris
XSharp Development Team
chris(at)xsharp.eu

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

Last edit: by Chris.

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #8

  • wriedmann
  • wriedmann's Avatar
  • Offline
  • Posts: 1426
  • Karma: 6
Hi Dick, hi Chris,

this is the classical case for which the Documentation Project was built: document something in a informal way....

Since Chris gave me the permission to use his messages here to build entries in the Docs wiki, I'll add them immediatly.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

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

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #9

  • wriedmann
  • wriedmann's Avatar
  • Offline
  • Posts: 1426
  • Karma: 6
Hi Dick, hi Chris,

I have added two articles to the wiki now:
https://docs.xsharp.it/doku.php?id=assign_no_returnvalue
https://docs.xsharp.it/doku.php?id=virtual_methods

Since you both have the rights to write in the wiki, please feel free to modify these if you like or feel it should be explained better.

At least the article about the virtual methods need samples, but unfortunately I have not the time now, and will add them later (if they are not added by you).

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

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

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #10

Hi Dick,

ic2 wrote:
About the Assign: it's that simple; I actually didn't realize it didn't need the return value to work and thought I had to work out an alternative for Assign. E.g. there's some code saying:
if self:oImg:GetBackgroundColor( @RGB )
return oColor
endif
which seems to imply that the return value has some actual use.


You should be careful how you interpret things. The above example is a method call, not a property/assign. I would suggest you start as quickly as possible to use PROPERTY GET SET instead of ACCESS/ASIGN

Regards,
Johan
______________________
Johan Nel
George, South Africa

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

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #11

Dick,

XS9032 is not an error but a warning. Apparently you have the compiler option "Warnings as Errors" selected and then it looks like an error. It is also documented (but I agree there could be a better description) at: https://www.xsharp.info/help/xs9032.html .
XS0108 is also documented at https://www.xsharp.info/help/xs0108.html . This is also a warning. I will also add the explanation from Chris to the documentation.

The more that I think about it the more I am convinced that we should not separate the errors and warnings in the documentation, since I understand that in cases like this it can be difficult to find them.


Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

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

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #12

Hi Dick,

ic2 wrote: Same question for error XS0108 which is also skipped in the help:

Warning XS0108 'MultiImageWindow.Close()' hides inherited member 'StdImageWindow.Close()'. Use the new keyword if hiding was intended. Fab_PaintLib_Test D:\XSharpProjects\FabPaintlibsXsharp\Fab_PaintLib_Test\Wnd MultiImgView.prg 11

METHOD Close() 		
	//
	SUPER:Close()
	//
	SELF:oMulti:Destroy()
	//
return self

Again here, why not rather use the OnClosing/Dispose event to Destroy()? Sorry that I don't give an example, eyes a bit blurry today, but hopefully somebody else can assist if needed. If I recall there was quite a good example in the Vulcan help file regarding the use of the closing events.

Johan
______________________
Johan Nel
George, South Africa

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

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #13

Hello Johan,

We're just glad you are 'in' again!

My goal is for everything that we convert from VO to X# to keep as much as possible as it was. No changes, no improvement (if it ain't broke don't fix it). Same for replacing ASSIGN to PROPERTY. It may look more .Net but it won't work better.

Only after I see it works we may make changes but that means we must test every aspect again. I am now working on the Fab libs for which it is very difficult for me to test the correct working overall as it is not my product.

Dick

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

Last edit: by ic2.

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #14

You're probably right. I don't have "Warnings as errors" on but the warning and error tab are extremely confusing in VS, as almost anything in VS. If you click on on tab the other changes from "90 errors" to "0 of 90 errors". When I click on Warnings I see the XS108 and then I click on the error tab and it still shows the XS108. Usually clicking a couple of times changes the content of the tabs at some point in time but any logic is missing. So I may have seen an error which actually was a warning.

Therefore it's a good idea to merge the errors and warnings. You could maybe indicate if it is a warning or an error in the text?

Dick

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

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #15

Hello Chris,

I don't use ASSIGN's much in my own code but I agree that it's not very consistent to be able to assign of couple of values and return (even) another value in some cases. That is the reason I have usually used a regular method to do whatever must be assigned, instead of the ASSIGN itself.

About the help: I understand that help files are more formal but I encourage to use descriptions as you do in the forum. These are very clear and may help users much more than a shorter, formal description.

Dick

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

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #16

These are very clear and may help users much more than a shorter, formal description.

Amen!

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

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #17

Hi Dick,
this morning, my students decided that it was a day off, because they were needing some time to prepare their final exams...but nobody tolds me :(
Unexpectedly, I had time to work on FabPaintLib. :)

Ok, the version first running version compiled with X# is now available at my homepage, in the Downloads, XSharp section : It is far from perfect in the sense that it need Vulcan Runtime, and has been compiled in Vulcan dialect.

The next step might be to move to Core Dialect, but it means XSharp GUI and more.

HTH,
Fab

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

Last edit: by Fabrice. Reason: misspelling

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #18

Hello Fabrice,

You might want to edit the post "not available" to "now available"....

We shouldn't have started so quickly with converting it ;)Anyhow, no doubt you have a better version than we had so far. I'll directly delete what we had.

Anyone who has done something with HoverButtons or _SEUIXP?

Dick

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

Last edit: by ic2.

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #19

Hi Dick,

Those "Errors"/"Warnings"/"Messages" buttons in the VS ErrorList window are toggles, so you can choose to Show/hide errors, Show/Hide warnings etc.

About distinguishing warnings to errors, Errors have a red "cross" image to their left, in the first column, while warnings have a yellow triangle shown.

Chris
XSharp Development Team
chris(at)xsharp.eu

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

Conversion or application of well known VO libraries to X# 9 months 2 weeks ago #20

Hi Wolfgang,

docs.xsharp.it/doku.php?id=assign_no_returnvalue

[...]

assign MyVar( cMyVar as string ) as void pascal class MyClass
_cMyVar := cMyVar

return _cMyVar

[...]..

i think you meant "return" , instead of "return _cMyVar"

regards
Karl-Heinz

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

  • Page:
  • 1
  • 2