|
"If it ain't broke, don't fix it."
Start a new project with the latest version - no point in upgrading software if you aren't adding features, all you do is risk adding problems or inefficiencies because you aren't fully familiar with a new framework (however similar it may be).
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Having read the comments on your article about non binding MVVM I imagine your "upgrade" would be a bloody nightmare having gone down a non standard path (assuming you have maintained that style).
The greatest nightmare of a one man show - when do I HAVE to move to the latest version of my tool(s), all the while building technical debt. Think of the poor sods still on VB6!
I agree with OG - you need the income stream and stability, unless your clients are screaming for the latest version I would leave it. When (Ghu forbid) they demand you go to a browser based solution then you change!
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
That "MVVM without binding" project was such a failure that the last time you flew in a commercial jet, the turbine blades might have been shaped by that software
My clients (industrial machine builders) wouldn't know a Framework from a Core from a Standard unless I whacked 'em on the head with them.
|
|
|
|
|
I found it easy to move from WPF to UWP, and now prefer UWP because of the Windows Store though I think you can move WPF to the store now (easy customer distribution). I also think the UWP event model is more comprehensive. And there's local and roaming storage, etc. Nothing you would miss unless you went looking, and then you do.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
I moved many thousands of lines from .Net Framework 4.x to 4.81 to finally move them to .Net 3 up to .Net 7.0 (including WPF programs). The main job is to redo the project in the new .Net format, compile and correct the few compilation errors you found. This answer gives a hint on the difficulty problem but don't address the importance of porting it to .Net Core.
Jacques Fournier
Consyst SQL Inc.
www.consyst-sql.com
|
|
|
|
|
Bruce Greene wrote: My question is - how important is it that I drop
You have two customer bases
1. Existing
2. New
For both types of customers do they buy new hardware? How often do they upgrade windows?
Leaving it as is runs the risk of, at some point, your software will fail in some odd way or not run at all because of updates to windows.
However updating also runs the risk that will not run on older versions either.
These days older apps also have an increased security risk. Or at least it is perceived that way. So it is possible at some point that something (like a virus checker) might flag the app for something. Which makes customers nervous.
You might also want to validate how exactly your build process works. If you are expecting to be able to download libraries (specific versions) any time you want at some point that might no longer be possible. You can address that keeping the libraries in your own source control and download nothing.
Besides the customers the primary way is to look for "end of life" for anything. Could be operating system, libraries, hardware etc.
For the version you specified above the date is April 26, 2022. It is unlikely anything will fail now. But you probably don't want to still be waiting 5 years from now.
Microsoft .NET Framework - Microsoft Lifecycle | Microsoft Learn[^]
If you have customers that do not upgrade then you will also need to plan on continuing supporting them. Note that this also means that you will need to have hardware and operating system that you can both test on and develop on. Keeping in mind however that even if it is good money maker at some point even they will find it difficult to keep running with the old equipment. Although some people are very ingenious at finding sources.
|
|
|
|
|
Using C# and Word 16.0.
var wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Visible = false;
Document wordDoc1 = wordApp.Documents.Add();
Document wordDoc2 = wordApp.Documents.Open(@"c:\users\robertsf\desktop\doc2.docx");
When this code executes, wordDoc1 gets clobbered, everything returning COM Exception, and wordApp.Documents contains only one object, the opened document.
var wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Visible = false;
Document wordDoc1 = wordApp.Documents.Add();
Document wordDoc1a = wordApp.Documents.Add();
Document wordDoc2 = wordApp.Documents.Open(@"c:\users\robertsf\desktop\doc2.docx");
When this code executes, wordDoc1 gets clobbered again, but wordDoc1a is fine, and wordApp.Documents contains two objects.
var wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Visible = false;
Document wordDoc2 = wordApp.Documents.Open(@"c:\users\robertsf\desktop\doc2.docx");
Document wordDoc1a = wordApp.Documents.Add();
When this code executes, however, everything is fine. wordApp.Documents contains two objects, and each object is accessible, as expected.
I'm trying to programmatically create a new document and copy the text of a variable number of documents into it. I suppose I could open all the source documents before creating the destination document. Or I could try to create two instances of Word.Application , one for the source documents and one for the destination document, and then see if I can copy between the two instances.
Here's the MS documation.
Add: Documents.Add(Object, Object, Object, Object) Method (Microsoft.Office.Interop.Word) | Microsoft Learn[^]
Open: Documents.Open Method (Microsoft.Office.Interop.Word) | Microsoft Learn[^]
I don't see anything about one operation overwriting the other. ¯\_(ツ)_/¯
|
|
|
|
|
I was going to delete this, but I'll leave it up in case someone else has the same problem. Here's the solution -- the call to Documents.Open has to have more arguments. The MS documentation says they're optional, but there are side-effects to not providing them.
var wordApp = new Microsoft.Office.Interop.Word.Application();
wordApp.Visible = false;
Document wordDoc1 = wordApp.Documents.Add();
Document wordDoc1a = wordApp.Documents.Add();
Document wordDoc2 = wordApp.Documents.Open(@"c:\users\robertsf\desktop\doc2.docx",
false, false, false, "", "", false, "", "", WdOpenFormat.wdOpenFormatAuto,
MsoEncoding.msoEncodingUTF8, false, false, none, none, none); Now it works as expected. I haven't experimented to see exactly which argument caused the issue.
|
|
|
|
|
This is my code.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
public float JumpY = 10;
public float JumpZ = 1;
public float JumpX = 0;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
if (KeyCode.Space = true)
{
transform.translate(0, 10, 1);
}
}
|
|
|
|
|
Just like the error says. You're missing a closing curly brace at the end of the code.
If you're not indenting your code properly, it's easy to lose track of the braces that should match up.
|
|
|
|
|
To add to what Dave said, you should expect to get syntax errors every day, probably many times a day while you are coding - we all do regardless of how much experience we have! Sometimes, we misspell a variable, or a keyword; sometimes we forget to close a string or a code block. Sometimes the cat walks over your keyboard and types something really weird. Sometimes we just forget how many parameters a method call needs.
We all make mistakes.
And because we all do it, we all have to fix syntax errors - and it's a lot quicker to learn how and fix them yourself than to wait for someone else to fix them for you! So invest a little time in learning how to read error messages, and how to interpret your code as written in the light of what the compiler is telling you is wrong - it really is trying to be helpful!
So read this: How to Write Code to Solve a Problem, A Beginner's Guide Part 2: Syntax Errors[^] - it should help you next time you get a compilation error!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
It's like a cursor only larger and more complex.
|
|
|
|
|
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with - we get no other context for your project.
Imagine this: you go for a drive in the country, but you have a problem with the car. You call the garage, say "it broke" and turn off your phone. How long will you be waiting before the garage arrives with the right bits and tools to fix the car given they don't know what make or model it is, who you are, what happened when it all went wrong, or even where you are?
That's what you've done here. So stop typing as little as possible and try explaining things to people who have no way to access your project!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
By creating an object based on a "Control"; and by varying it's .Left and .Top properties at run time over a given interval.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
|
|
|
|
|
Make a system that will allow the user to add, modify, display, search and delete records in a derived classes.
Base class is 'Person'
Subclasses of Person = Employee and Student
Under Employee we also have subclasses namely= teacher and staff member.
Please help me.
|
|
|
|
|
This is the C# forum, not C++. That's here[^].
Again, you'll have to describe the problem you're having. Just saying "I need help" will not do.
|
|
|
|
|
Again, two things:
1) This is a C# forum, not C++. The two languages look similar, but are very, very different.
2) While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.
So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
Just posting your assignment isn't going to get you anywhere.
If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
Posting the same homework multiple times isn't going to get you more, help: it probably will get you less.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Make a system that will allow the user to add, modify, display, search and delete record in a derived class 'Student'
Base class is 'Person'
|
|
|
|
|
Did you have a question or a problem with your code?
We're not here to do your homework for you.
|
|
|
|
|
Two things:
1) This is a C# forum, not C++. The two languages look similar, but are very, very different.
2) While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.
So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
Just posting your assignment isn't going to get you anywhere.
If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I am trying to run a process which is invoked from either a C# or C++ program. The process has its standard output and standard input redirected to the program which invoked it. In this way, the calling program can control the child process programmatically. (The child process happens to be the MAME arcade emulator so I can run commands through the Lua console.)
Things look about how I would expect them from the C++ program. I can read the output from the child process with the PeekNamedPipe() function. The characters are identical to what I see when I just run the process from the command line and observe the console.
But when I run a similar C# program, the console output is not quite right. There are at least two issues. Using the Streamread read() method (the child process's stdout is directed to a stream), there are always about 30 "junk" characters that are read back before I see the characters I expect. Additionally, it appears that the characters at 16-bits (not 8-bit chars). (I can live with this, and I think I can convert them into 8-bit chars if I need to.)
I have a strong suspicion that these characters are actually some low-level "under the hood" info about the string itself, like some kind of reflection data - maybe details about how it's encoded, length, etc.
I just can't seems to figure out how to cleanly extract the "real" data out of the stream using C#.
Can anyone make sense of this and give a hint of how I can get ASCII character data from the child process in C#?
Thanks!
|
|
|
|
|
C# uses Unicode - and the console it writes to is also Unicode by default.
You may get better results using the Console.OutputEncoding Property[^] set to Encoding.ASCII , but I've never needed to try myself.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I have tried the suggestions found here and elsewhere but still no joy!
DataTable dataTable = new DataTable();
foreach (DataGridViewColumn col in dataGridView1.Columns)
{
dataTable.Columns.Add(col.Name);
}
foreach (DataGridViewRow row in dataGridView1.Rows)
{
DataRow drow = dataTable.NewRow();
foreach (DataGridViewCell cell in row.Cells)
{
drow[cell.OwningColumn.Name] = cell.Value;
}
dataTable.ImportRow(drow);
dataTable.AcceptChanges();
}
modified 23-Oct-22 6:13am.
|
|
|
|
|
If I use your code, but replace the ImportRow with your commented out Rows.Add code, it works fine for me:
private void MyOtherButton_Click(object sender, EventArgs e)
{
DataTable dataTable = new DataTable();
foreach (DataGridViewColumn col in myDataGridView.Columns)
{
dataTable.Columns.Add(col.Name);
}
foreach (DataGridViewRow row in myDataGridView.Rows)
{
DataRow drow = dataTable.NewRow();
foreach (DataGridViewCell cell in row.Cells)
{
drow[cell.OwningColumn.Name] = cell.Value;
}
dataTable.Rows.Add(drow);
dataTable.AcceptChanges();
}
MyOtherDataGridView.DataSource = dataTable;
}
I get identical DGV's side by side ...
So what am I doing that you aren't?
And why are you doing this ass backwards? Normally you use the DataGridView.DataSource to populate data, not the actual rows and columns ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Please forgive me for being a bit slow. I am 70 years old and have just started getting back to programming because I can't do much else these days.
My aim is to be able to save the DataGridview data to a spreadsheet using EPPlus.
This is the code to get the data into the spreadsheet from a data table.
using (ExcelPackage pck = new ExcelPackage(newFile))
{
ExcelWorksheet ws = pck.Workbook.Worksheets.Add("Accounts");
ws.Cells["A1"].LoadFromDataTable(dataTable, true);
pck.Save();
}
I do not have any code to populate the spreadsheet directly from the DataGridView.
If you could show me how to hook up a DataTable to get the data from a DataGridView using a Datasource or another method I would be very thankful.
|
|
|
|
|