Notifications
Clear all

Windows Forms Programs in C# or any other language

27 Posts
6 Users
1 Likes
6,038 Views
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@robo-pi

Posted by: @robo-pi

I should have been done last night but for some reason it's not recognizing that variable shave been declared.  But they are declared in the header file.   So it's one of those things where everything appears to be correct, but the compiler still complains and won't compile.   All it says is that the variables aren't defined.  But as far as I can see they are defined.   So what do you do now?

Compilers are pretty smart, so I'm assuming with great confidence that you stuffed it up somewhere 😀

In all seriousness, sometimes when you start playing with creating libraries, you will encounter a time when you need to use extern "C". This tells the compiler, somewhere amongst all the header and implementation files (AKA: translation units), there is a variable that exists.  It doesn't matter in which file you define it, but using extern "C" will inform the compiler that it exists somewhere, and not to include it more than once making available to each translation unit that requires it.

Cheers!


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@jrbdeveloper

Posted by: @jrbdeveloper

I wouldn't bother with trying to work with c++ in a WinForms manner given that c# is a better language.

That's quite a bold claim! 😀

Posted by: @jrbdeveloper

I mean that from the perspective that it offers more by way of OO design principles (interfaces and classes, Abstracts and Partials).

Do you care to elaborate on this claim, for example, what does C# offer in OOP over and above C++?

Posted by: @jrbdeveloper

My only advice would be to be careful not to trap yourself with a technology that will eventually be unsupported.

🙂

I have to say, this is one of the biggest reasons that you actually do want to use C++, because it *IS* a world renowned portable "systems programming language" that will compile to native code on any platform, when sticking to the standard library as defined by the ISO committee.  Microsoft languages do not only have a reputation for not being portable at all, and as a company, they are the most likely of all to pull the plug on a language and platform from under ones feet than anyone else, and they have proved it time and time again over many years.

I would not trust interpreted C# code on a space ship controller or navigation system let alone any machinery where safety is a huge concern - C and C++ are trusted for this very reason, especially in embedded systems... their proven success in potability and robustness over many years cannot be so simply downplayed.

Posted by: @jrbdeveloper

Both in terms of revision updates and well as the operating system it will run on. It used to be modern to use ActiveX controls in Visual C++ and VB but mostly those things wont operate on current versions of Windows.

Again, I think you've proven my point yourself... why do you think they no longer work?
What happened to all those other languages Microsoft created?

Both C and C++ are still used today because of their robustness, speed and ongoing international ISO standards support for mission critical systems.  Microsoft recognise this too, that's why they always include it as part of their development platforms - They just want you to use theirs instead, for reasons I'm sure you can guess 🙂

Cheers!


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @frogandtoad

Do you care to elaborate on this claim, for example, what does C# offer in OOP over and above C++?

In programming languages there are no absolute answers.  It all depends on what a person is using the language for.  See the following article:

C# vs. C++: Which Language is Right for Your Software Project?

C# has many advantages for someone who just wants to write programs without having to be bothered with paying attention to all the details, such as garbage collection.   C# takes care of garbage collection for you.  That's a huge plus for someone who isn't interested in having to deal with that.

C# has a higher level of abstraction, making it easier for someone who just wants to get on with programming.

If a person is targeting their finished product to be run on Windows, then this isn't a "limitation" for them. It would only seem to be a limitation to those who want to write programs that will run on any platform.

Again, it's a trade-off.  It's simply easier to use when writing program just for Windows.  You need to take extra steps to write programs that are truly compatible with many different platforms.  So if you don't need that capability why jump through those hoops?

As the article suggests the question isn't which is the best language, but rather which is the right language for your project?   That's a different question entirely.

If C# is easy to use and does what I want to accomplish, then it's the "Right" language for the project.

Getting bogged down with having to allocate space and collect garbage every time I want to do something would be extra work.   Why bother when C# does all that for me automatically? 

It's kind of like arguing which is better a stick shift, or an automatic?  We could argue that you have more control with a stick shift, and possibly even better power transfer (slightly better efficiency) but in the end if all you want is a car that you can drive in the city without having to constantly push in and release a clutch pedal, or start out on a steep hill when the guy behind you pulled right up to within inches of your bumper, an automatic might be the best choice after all.

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
jrbdeveloper
(@jrbdeveloper)
Member
Joined: 4 years ago
Posts: 12
 
Posted by: @frogandtoad

@jrbdeveloper

Posted by: @jrbdeveloper

I wouldn't bother with trying to work with c++ in a WinForms manner given that c# is a better language.

That's quite a bold claim! 😀

Posted by: @jrbdeveloper

I mean that from the perspective that it offers more by way of OO design principles (interfaces and classes, Abstracts and Partials).

Do you care to elaborate on this claim, for example, what does C# offer in OOP over and above C++?

Posted by: @jrbdeveloper

My only advice would be to be careful not to trap yourself with a technology that will eventually be unsupported.

🙂

I have to say, this is one of the biggest reasons that you actually do want to use C++, because it *IS* a world renowned portable "systems programming language" that will compile to native code on any platform, when sticking to the standard library as defined by the ISO committee.  Microsoft languages do not only have a reputation for not being portable at all, and as a company, they are the most likely of all to pull the plug on a language and platform from under ones feet than anyone else, and they have proved it time and time again over many years.

I would not trust interpreted C# code on a space ship controller or navigation system let alone any machinery where safety is a huge concern - C and C++ are trusted for this very reason, especially in embedded systems... their proven success in potability and robustness over many years cannot be so simply downplayed.

Posted by: @jrbdeveloper

Both in terms of revision updates and well as the operating system it will run on. It used to be modern to use ActiveX controls in Visual C++ and VB but mostly those things wont operate on current versions of Windows.

Again, I think you've proven my point yourself... why do you think they no longer work?
What happened to all those other languages Microsoft created?

Both C and C++ are still used today because of their robustness, speed and ongoing international ISO standards support for mission critical systems.  Microsoft recognise this too, that's why they always include it as part of their development platforms - They just want you to use theirs instead, for reasons I'm sure you can guess 🙂

Cheers!

First, lets agree that there is a context to this discussion and that is that we are talking about building out a WinForms application. Its an MDI application meant to run on Windows and that its an app meant to serve as a test harness for functionality that may be destined for Arduino C++ or maybe Python, not certain. Its not intended to be cross platform so that it can run on Linux and/or MacOS. Given the context, C# is the better language because as Robo Pi points out in his post, it offers more in so many ways. I wont enumerate the points again as he already did a fantastic job doing that.

Everything else you "call me out on" in your post is outside the bounds of that context. My comments regarding being weary about the subtleties in choice between historical WinForms vs WPF have nothing to do with Microsoft sun-setting languages but rather sun-setting things within a set of languages. For instance, ActiveX, WCF, Silverlight. 

I would not trust interpreted C# code on a space ship controller or navigation system let alone any machinery where safety is a huge concern - C and C++ are trusted for this very reason, especially in embedded systems... their proven success in potability and robustness over many years cannot be so simply downplayed.

This comment is out of context and is special pleading. We're not talking about embedded systems and we're certainly not talking about space flight. Your post is filled with examples like this where the argumentation isn't constructive. Honestly Im not interested in these discussions. It'd be far better to pick a topic, explore it through constructive conversation rather than pile on a bunch of topics that become difficult to track and take anything away from. Im here to learn about micro-controllers, micro-computers, robotics and general electronics. Im not going to entertain a defense in cases like this as it is likely to devolve into nothing constructive or helpful.

The unexamined life is not worth living - Socrates


   
ReplyQuote
frogandtoad
(@frogandtoad)
Member
Joined: 5 years ago
Posts: 1458
 

@jrbdeveloper

Posted by: @jrbdeveloper

First, lets agree that there is a context to this discussion and that is that we are talking about building out a WinForms application.

First, let’s begin by acknowledging that my questions to you had absolutely nothing to do with WinForms per se, but rather the claims you made about the OOP features C# offers, for example in terms of design. Therefore, if you wish to introduce a context, then my questions are what makes up the context.

Just so there is no ambiguity, here is what you stated, and my questions, specific to these statements.  

You:
I mean that from the perspective that it offers more by way of OO design principles (interfaces and classes, Abstracts and Partials)

Me (Q1):
Do you care to elaborate on this claim, for example, what does C# offer in OOP over and above C++?

You:
My only advice would be to be careful not to trap yourself with a technology that will eventually be unsupported

Me (Q2):
I have to say, this is one of the biggest reasons that you actually do want to use C++, etc. I then went on to provide some detail as to why C++ had actually been widely supported under international standards, etc.

As you can see, I asked you questions based on these two claims, and there is absolutely nothing here about building WinForms.

Posted by: @jrbdeveloper

Everything else you "call me out on" in your post is outside the bounds of that context.

Sorry, but not one of my questions to you, falls within this artificial context and constraint you’re trying to force upon my response.

Posted by: @jrbdeveloper

Im not going to entertain a defense in cases like this as it is likely to devolve into nothing constructive or helpful.

Due to recent language discussions, my post started with a smiley and I had used three in total… but sadly, I don’t think you understood their meaning.  Again, there was nothing out of context in my questions, no matter how many times you say it - My questions are pasted above for reference, very specific and clear, I simply asked you if you could provide information specific to your claims.

What is clear however, is that you do not want to, or cannot answer my questions, and given the direction your response has taken this discussion, I will not add to it any further.


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @jrbdeveloper

I wouldn't bother with trying to work with c++ in a WinForms manner given that c# is a better language

I agree that C# is the better language for writing WinForms as that was precisely what it was designed for.

I think this context is important here.

@frogandtoad I think you may have misunderstood. When jrb was suggesting that C# is the better language he was referring to the context of being used to create WinForms applications. I don't think he ever meant to imply that the C# is overall a better language than C++ in all situations.

Posted by: @jrbdeveloper

Im here to learn about micro-controllers, micro-computers, robotics and general electronics.

This is my purpose as well. ?

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Duce robot
(@duce-robot)
Member
Joined: 5 years ago
Posts: 672
 

@robo-pi

I've been watching the nano series bouncing around between lessons 1-4 learning a lot have you watched the series on the 9 axis sensor looks like it would be good for RPI camera .I'm blown away with the headless mode that's the way to go ......I haven't attempted it yet lol the only problem is my handy man brain can't take it all in between this project and those tutorials lol I'm still going to give it a shot though thanks for bringing those to my attention without the tutorials I would be fumbling around gropeing around the country side on the ground sifting my hands through the sands of the ai dessert .??? cause this stuff just isn't out there at a beginner's level.good news they are starting to snap the little with fi antenna's together mine came assembled!???

1579964588834925875471

 


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @duce-robot

without the tutorials I would be fumbling around gropeing around the country side on the ground sifting my hands through the sands of the ai dessert .??? cause this stuff just isn't out there at a beginner's level.good

And I'd be right there with you buddy!   This series by Paul McWhorter is a gold mine!  Imagine having to figure out all the little quirks he explains.   It would be an absolute nightmare.  NIVIDIA should be sponsoring him big time!  I don't think there's any YouTuber out there who is doing such a great service for NIVIDIA.

There are other YouTubers who cover the Jetson nano, but not anywhere near the detail that Paul goes into.  In fact, I've watched some other YouTube videos on the Jetson Nano and actually came away more confused than before I watched them!  That's no joke either!

Yep, Paul's the man for anyone wanting to get into the Jetson Nano.  No question about it.

Even the official NIVIDIA videos aren't as good.

By the way, if you haven't already, I'd strongly recommend buying the case for.  It's $14 but well worth it.  And the acrylic case that Paul uses is just fine.  If you do everything correctly it fits together perfectly.  You just need to be sure not to get any wires caught between the case and the Nano.  There's no room for sloppy builds.  As long as you are careful to be sure not to squish any wires between the case and the Nano it should go together perfectly.   It's an extremely close fit, but it does fit if you don't get any wires caught.   If you get wires caught it's going to  be a nightmare and not good for the wires either.   If you get it together properly it makes for a rock solid case.   And even has mounts for the antennas.   And the camera!

DroneBot Workshop Robotics Engineer
James


   
Duce robot reacted
ReplyQuote
Duce robot
(@duce-robot)
Member
Joined: 5 years ago
Posts: 672
 

@robo-pi

He just finished a live tutorial on object recognition lesson 21 I think it was pretty good.we need to get him on the forum lol the poor guy wouldn't get a minutes peace. Lol


   
ReplyQuote
Robo Pi
(@robo-pi)
Robotics Engineer
Joined: 5 years ago
Posts: 1669
Topic starter  
Posted by: @duce-robot

He just finished a live tutorial on object recognition lesson 21 I think it was pretty good.we need to get him on the forum lol the poor guy wouldn't get a minutes peace.

He  does do live interactive chats with those who follow his videos.   I don't think he would want to waste too much time answering questions from people who never watched his videos.   Instead of wasting time answer their questions he's be far better off just telling them to go watch the videos where he had already explained everything in detail. ? 

He is also producing several videos a week.  He has a course on the Arduino and the Elegoo starter kit.  He has a course in the 9-axis IMU.  And the course on A.I. with the Jetson Nano.  I think he also makes other videos on a regular basis too.  I have no idea how he keeps up with everything.   He must have some super fast computers because he sure doesn't have any time to waste waiting on slow computers.

I'm trying to complete my first video here and I'm just about to give up and break down and buy a computer that can actually do the job!    My computers are so slow most of my time is spent waiting for the computers to do something.   I'm even using multiple computers so I can have video rendering on one computer while I'm editing video on another computer.  That helps to some degree.  But there's still the lag time between when I click on something and when the feature I'm looking to apply actually pops up!  That's the annoying part .

DroneBot Workshop Robotics Engineer
James


   
ReplyQuote
Duce robot
(@duce-robot)
Member
Joined: 5 years ago
Posts: 672
 

@robo-pi

Yes I have to get back to videos also I think a really good camera will go a long way he has to be getting at least some help these tutorials are so involved just look at the one for the nine axis sensor couple that with the ai  videos he's a mad man ??


   
ReplyQuote
(@ronrus)
Member
Joined: 4 years ago
Posts: 1
 
Posted by: @robo-pi

Does anyone know how to back up an entire solution?  I can't find anything in Visual Studio to make a back-up copy of the entire solution.   So what I've been doing instead is going into Windows explorer and just backing up the entire solution directory.   That does work.  But it seems to me there should be a way to back up the solution from within Visual Studio.  There probably is a way to do this, and I just don't know where to find it.

As far as I know, there isn't. Unless you count version control as a backup. If you haven't already, I suggest you use a version control, even if you work on this alone.
I can recomend https://azure.microsoft.com/en-us/services/devops/, free and integrated in Visual Studio.
Very nice to be able to roll back if you make any mistakes 🙂

This post was modified 4 years ago by RonRus

   
ReplyQuote
Page 2 / 2