|
We have a number of older products built using C++ and MFC, along with an inhouse tool started in 2000 and under active maintenance today. Our newer products use C# and WPF for the UI.
For complex UI or UI constructed dynamically in code WPF is the way to go. Doing the same thing in MFC is tedious, requires a lot more plumbing, and sometimes simply isn't feasible. For what it's worth, I find WPF to have a simpler mental model for constructing user interfaces. I've found the key to using it effectively is to ignore the "declarative" purists and build what works.
On the other hand if you're doing something with a lot of Windows API calls ("system programming" back in the day), C/C++ is a better approach. While it's true you can call most of the API using Platform/Invoke, some things are just a pain to translate (access control lists for example).
As always, it's a matter of choosing the proper tool for the job.
Software Zen: delete this;
|
|
|
|
|
For those that require many calls to the OS, I found that writing COM objects in C++ to access the OS is far easier than PInvoke calls. You access the COM objects through .Net RCWs.
Just watch out to correctly implement IDisposable on classes that host your COM/RCW objects, especially if you are managing unmanaged resources.
|
|
|
|
|
You're not wrong about the learning curve part. WPF's learning curve isn't horrific, but it's more work than not using it.
But the biggest reason IMO is how long it takes to do things in WPF. What is your app for? Will a shiny WPF interface make it work better or more productive? I'm gonna go out on a limb and say that the majority of the time the answer is no.
Yoda knew the answer: Winforms is "quicker, easier, more seductive."
|
|
|
|
|
That's actually context dependent which is more difficult. Even the most basic Forms and Custom Controls, which can be a requirement in even the simplest data entry/LOB applications, are far more difficult to write and implement in WinForms than in WPF.
One of the very core strengths, which is also its weakness vis-à-vis learning curve, is the emphasis on reusability. Control templates, data templates, triggers, etc. are very powerful paradigms that are very difficult to implement in WinForms, and lead to overly complicated code.
|
|
|
|
|
Message Closed
modified 27-Feb-24 11:59am.
|
|
|
|
|
Yes, well ... very witty.
(Remind me people, why don't we have a "Sarcasm" emoji?)
"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!
|
|
|
|
|
|
Recently, a very public comments section let me use "p*ssed (off)" (with the *) in a sentence. Surprised me too. It still maintains a cerain standard (IMO).
"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
|
|
|
|
|
Eh ?
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
It's a response to a deleted thread starter message: a pictogram of a stickman with a turd emoji for a head ...
If you check the "parent" indicator on the left when you hover you'll see it goes into the abyss.
"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 don't see the parent indicator on the original post
In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP
|
|
|
|
|
Hover your mouse over the message I wrote, and the "parent" indicator appears: a thin vertical line. If you follow it up, it points above all messages which indicates the thread started has been deleted. Normally it stops at the parent message.
"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!
|
|
|
|
|
The other thing you can do is "View Thread" which displays a Message Closed message at the root.
|
|
|
|
|
So, what's your SQL resources for beginners and related to JOINs ?
I'm kind of stuck on request that should use JOIN and can't figure out how to make it work.
I somewhat understand how it works, but there's something missing in my understanding of the universe.
Thanks.
CI/CD = Continuous Impediment/Continuous Despair
|
|
|
|
|
|
If SQL Server... For simple things, you could try using SSMS' visual designer for creating a view.
|
|
|
|
|
Fresh from Eric Darling[^]. It talks about Joins.
Jack of all trades, master of none, though often times better than master of one.
|
|
|
|
|
I’m not going to talk about right outer joins, because that’s the foolish domain of characterless buffoons who use Venn diagrams to explain join results.
/ravi
|
|
|
|
|
I generally start with W3Schools SQL Tutorial[^] - they explain the basics, and provide DB samples and sandboxes so you can try it yourself without installing the heavyweight monster that is Sql Server.
Basically, SQL is a relational DB - it works with multiple tables to relate data to other data, unlike for example CSV which is a flat self contained file where all related data in combined into a single row.
So you can have an Invoices table (which holds the invoice date, customer, delivery address, and taxes / total owed) and a InvoiceLines table (which holds the items that were purchased: product, unit price, quantity, discount, Item total, InvoiceID).
To look at a whole invoice, you use a JOIN:
SELECT i.InvoiceDate, i.Total, i.PaidStatus, l.Product, l.UP, l.QTY, l.Disc, l.itemTotal
FROM Invoices i
JOIN InvoiceLines l ON l.InvoiceID = i.ID
WHERE i.ID = 123456 The InvoiceID relates the two bits of information and returns only the relevant data.
"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 would second W3Schools! It has very helpful learning tools that I still rely on at times when I am trying to remember how to do something...
Steve Naidamast
Sr. Software Engineer
Black Falcon Software, Inc.
blackfalconsoftware@outlook.com
|
|
|
|
|
|
I was trying to work up the courage to suggest MS Access - fearing that same heck.
Bring your data, or let it build a template application for you.
Visually design your query, then change to the SQL view and figure out what it is doing.
You can write SQL that the visual designer cannot present (eg. sub-select).
You cannot write all SQL (eg. cartesian join).
Whilst you may not want to deploy it as an application (I have), it works to model or proof-of-concept for a business app.
b
|
|
|
|
|
MS Access...
Or anything that lets you visually design your query and then flip to SQL to see the SQL generated for what you did.
For a beginner, I think you'll pick up more and faster doing it that way than just googling/reading docs.
|
|
|
|
|
I find books with "Recipes" in the title useful; as in: "SQL Cookbook". The "Q&A" format (by "category") is the least time wasting when looking for a solution or insight into one.
"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
|
|
|
|
|