VO.WCError

This forum is meant for questions and discussions about the X# language and tools
User avatar
Kees Bouw
Posts: 119
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

VO.WCError

Post by Kees Bouw »

Hi,

When I add a VO Window, exported with VO XPorter, to my X# application, most of the time I get a run-time error "VO.WCError" like in this picture:

Image

The window is added by choosing Add -> Existing Item and then I select the prg, the xsfrm and the rc file.

I can fix this error by choosing Build -> Clean Solution and then Build -> Rebuild Solution.

Because I have to import a lot of windows this is a bit annoying. It is my impression that it happens more often with version 2.20 than it happened with version 2.19.

Also, when I click "View Details" a QuickWatch windows appears with error XS0726 which is not very helpful.

Is there anything I can do so that I do not always get this run-time error?

Kees.
User avatar
Chris
Posts: 4907
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: VO.WCError

Post by Chris »

Hi Kees,

Ouch, adding existing windows this way is really pushing it, those are meant to be "one" entity. Why are you doing it this way, had you previously excluded them from the project? Or are you moving them from one project to another? What is exactly the way you are working with them? Maybe we can offer a better alternative method of doing it..
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Kees Bouw
Posts: 119
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Re: VO.WCError

Post by Kees Bouw »

Hi Chris,

Thank you for your reply. I have exported aef's from the VO-project, ran them through the VO XPorter, and then you get these 3 files for each window. I know of no other way to add these to the X# project than with Add -> Existing item. Code-only files are just prg's and adding these in the same manner never gives a problem. For menu's I import a prg, rc and xsmnu file and that goes well too. But the windows are giving this problem most of the time. After Clean and Rebuild everything works but I wish that would not be necessary. If there is a better way, please let me know!

Kees.
User avatar
Chris
Posts: 4907
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: VO.WCError

Post by Chris »

Hi Kees,

VOXporter already adds those files as part of the VS project that it creates, why do you need to add them again?
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Kees Bouw
Posts: 119
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Re: VO.WCError

Post by Kees Bouw »

Hi Chris,

The VO project consists of 11 modules, so 11 AEF's. Each of these AEF's when run through the VO XPorter, gives a Visual Studio solution. Apart from the fact that I don't know how to integrate 11 solutions into 1, I do not want that. The entire code generates millions of errors and warnings in X# and I want to import the code piece by piece so it is manageable. Most of it is already done this way. It is just that adding windows has always been a bit problematic and now with X# 2.20 it seems to have gotten even worse.

A related question. The VO XPorter also created Winforms versions of the windows. These are all together in one folder called "Windows.Forms" and it seems that each window consists of a prg, Designer.prg and prg.wed file. What would be the best way to replace an existing VO Window with the Winforms version? Maybe delete the VO Window and add these 3 files with Add -> Existing Item? I would like to improve the X# version by gradually replacing the VO Windows with Winforms one step at a time.

Kees.
User avatar
Chris
Posts: 4907
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: VO.WCError

Post by Chris »

Hi Kees,

I guess it's too late now, but you could just add the projects one by one in the main solution that you are working on. What you needed to do is to select Add Existing->Project and select the .xsproj file. Anyway, we will look into the vowindow add problem, maybe it can be improved a bit.

About converting VO windows to winforms, that actually involves rewriting their code, because winfroms uses different control names, properties, database system etc than the VO GUI. The windows generated by VOXporter only act as a starting point so at least you do not need to also visually design them from scratch. After you're fully done with the conversion, maybe you can look into changing windows gradually.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Kees Bouw
Posts: 119
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Re: VO.WCError

Post by Kees Bouw »

Hi Chris,

Most of the projects would still contain too much code to import in one go I think. Also, the projects are all dependent on each other because the windows, the classes, inheritances and code are not placed together in a sensible way but scattered all over. The approach I took was to begin with the startup code and settings, then import based on functionality. So import all the code (spread out over several projects) required to perform a specific task of the application and make sure that works.

Kees.
User avatar
Kees Bouw
Posts: 119
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Re: VO.WCError

Post by Kees Bouw »

Chris wrote: Mon Jul 15, 2024 4:13 pm Hi Kees,
Ouch, adding existing windows this way is really pushing it, those are meant to be "one" entity.
Chris,

Just wondering, why is this way of adding "really pushing it" and what do you mean by that it should be one entity? The code for a window is always split in 3 files I think.

Kees.
User avatar
Chris
Posts: 4907
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: VO.WCError

Post by Chris »

Hi Kees,
Kees Bouw wrote: Tue Jul 16, 2024 1:33 pm
Chris wrote: Mon Jul 15, 2024 4:13 pm Ouch, adding existing windows this way is really pushing it, those are meant to be "one" entity.
Just wondering, why is this way of adding "really pushing it" and what do you mean by that it should be one entity? The code for a window is always split in 3 files I think.
I mean that those files are meant to be created all together at once, with internal interconnections to each other in the project system, when generating a new such window, or by VOXporter which also generates them as one thing. I am actually surprised it even works at all the way you are doing it, apparently Robert has added some special code to try to bind all together when you add them separately, but looks like this isn't working always perfectly.

It's like with Windows Forms, I haven't tried it to be honest, but I suspect even for c#, VS will have trouble if you try to add separately the window.prg, window.designer.prg and .resx file, which are meant to be created at once. Although maybe I should better try first before I speak..:)
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
Kees Bouw
Posts: 119
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Re: VO.WCError

Post by Kees Bouw »

Hi Chris,

They are all created together at once, that is why I add them all together at once ;) I do not change any of the 3 components individually, I just add all 3 together (meaning I select them all 3 together in the Add -> Existing Item dialog).
Anyway, I found that doing a Clean Solution after adding usually prevents the VO.WCError coming up. So it is only a minor inconvenience.

Thanks for your comments!

Kees.
Post Reply