Issues with creating a new WPF X# program

This forum is meant for questions and discussions about the X# language and tools
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Issues with creating a new WPF X# program

Post by ic2 »

Hello Terry,

I understand that.

If Microsoft developers also had some basic understanding of these concepts, their users wouldn't need to waste time with trying to get things working after such a simple action as renaming a default class name into a meaningful name.

Dick
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Issues with creating a new WPF X# program

Post by Chris »

Hi Dick,

I'm sure there are tons of extremely good programmers in MS. I suspect their structure is their problem, where they have managers for even very trivial stuff, product managers, managers managing managers, managers for managing management managing projects and so on..

I'm not sure how easy is for their smartest people to have things properly done in such an environment...

.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
TerryB1
Posts: 306
Joined: Wed Jan 03, 2018 11:58 am

Issues with creating a new WPF X# program

Post by TerryB1 »

I'm sure there's truth in all comments here, and as Chris says the spiders web of managers cannot help.

But if I take your statement literally, Dick, of simply renaming a class causing a problem, then it is something I have done many times without any problem. I know I am talking C# but it should apply across the board for all supported languages.

Terry
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Issues with creating a new WPF X# program

Post by ic2 »

Hello Terry,
Terry wrote: But if I take your statement literally, Dick, of simply renaming a class causing a problem, then it is something I have done many times without any problem. I know I am talking C# but it should apply across the board for all supported languages.
Then I would love to hear what you are doing differently than I did (or Chris did):

1 Add, New project
2 I change Project name WpfApplication1 to IC2WebExchange and, somewhere at the other end of my screen, there's a button Create
3 Now my XAML code says <Window x:Class="IC2WebExchange.WPFWindow1" so I rename WPFWindow1.xaml to WebExchange.xaml in the Solution Explorer.
4 This time I get a new VS surprise: Error HRESULT E_FAIL has been returned from a call to a COM component. But after 2 retries it works. Sometimes something works in VS, but not often directly.
5 Now both the xaml and the code behind .prg have been renamed. The program crashes as described above, which you only see in the debugger.
6 With an external program, I search for occurrences of WPFWindow1 and find these in app.xaml and the renamed xaml program + code behind.

Dick
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Issues with creating a new WPF X# program

Post by ic2 »

Hello Chris,
Chris wrote:Hi Dick,
managers for managing management managing projects and so on..
.
I am afraid you are right. So supposing that Microsoft does have good programmers, the question is then shifted towards "why don't they have good managers?"

Dick
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Issues with creating a new WPF X# program

Post by ic2 »

I've got another issue I fail to understand.

Within an X# solution containing multiple libs & exe's, I created that new WPF program. I want to rewrite an existing program to exchange MySQL webdata to get rid of the WCF code in that program. Currently the only difference is that I started this as an X# WPF program. I included the same X# DLL's (Core/Rdd/RT/VoRDDClasses/VoSystemClasses. I added an existing program (so Include statements are the same as well).

When I compile I get:

Error XS0246
The type or namespace name 'DbServer could not be found (are you missing a using directive or an assembly reference?)


Why? What am I missing?

Dick
TerryB1
Posts: 306
Joined: Wed Jan 03, 2018 11:58 am

Issues with creating a new WPF X# program

Post by TerryB1 »

Hi Dick

Just to acknowledge your last. It ceratinly merits looking into and I'll do so over the next few days.

There is some deeper problem/misunderstanding here - I've never had HRESULT errors, nor am I using PRG's.

On the face of it, it looks like problems looking in to legacy code. A problem I'm not likely to have with what I'm doing at the moment. I'm using VS 2022.

But none of that changes the basic principles. Need to give it more thought.

Terry
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Issues with creating a new WPF X# program

Post by Chris »

Hi Dick,

Not sure what those items in your error description mean, like those "X# Website" etc. Maybe a screenshot would help.

The error itself means that either you have not added references in your app/library to the required dlls (VORDDClasses.dll in this particular case), or you are trying to use the class "VO.DBServer" with its short name "DBServer", without a "USING VO" statement, or without having enabled the "Enable Implicit Namespace lookup" project option, which tells the compiler to do this automatically.

.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Issues with creating a new WPF X# program

Post by ic2 »

Hello Chris,
Chris wrote:or without having enabled the "Enable Implicit Namespace lookup" project option, which tells the compiler to do this automatically.
.
Of course, that's it again. Thanks!

As the new project was a part of an existing solution I simply didn't realize to go the project's Language settings, as I should have :blush:


Chris wrote: Not sure what those items in your error description mean, like those "X# Website" etc. Maybe a screenshot would help.
.
Oh, that was because I copied the error message from the X# web help. I will now edit the leading lines away....

Dick
ic2
Posts: 1858
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

Issues with creating a new WPF X# program

Post by ic2 »

Hello Chris,

I have 1 additional question here.

I did include VORDDClasses. Why doesn't it work then (as the only part of the program) without Implicit namespace lookup?

And why should I add, without implicit lookup, VO.DBServer or Using VO? This doesn't work either (Error XS0246 The type or namespace name 'VO' could not be found ) .

What does the implicit lookup lookup exactly what I can't achieve in he program?

Dick
Post Reply