• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

Learning C++ from C or Java

kleptophobiac

Supreme [H]ardness
Joined
Sep 24, 2001
Messages
7,839
Well, some time ago I asked about learning C from the Java programmer's perspective. The response I got was overwhelmingly for the K&R C book. It was sound advice and I've learned a lot. In the time since that post, I've designed and built several microcomputers, as well as used C to program for them.

Now, however, my needs are growing. I've been programming hardware interface code in Java to communicate with my little benchtop whizbangs, and it sucks. The Java commapi is horrible and poorly supported. Also, I need to leave behind a suite of useful software that requires no maintenance as I go from my current job to college. Java with it's endless updates of JRE, JDK, and fixing the resulting problems with the damned communication API is just not the answer.

So I figured my only real solution is C++. I need to be able to code fairly fast GUI based programs that have hardware level access (IEEE1394, RS232, EPP+ECP). C++ should be able to accomplish that goal without having the program break whenever Sun sends off a new version of the JVM. I don't want to use .NET for the same reason.

Many of the tutorials I found online were rather useless. There seem to be two varieties of tutorial. On the one hand, there are tutorials that are about the same for any language except for the syntax. They cover variables, loops, etc. In other words, the stuff I already know. Then there are the really specialized tutorials, covering IP networking, OpenGL, and other random topics I don't really care about.

What's a good book or online resource that will get me started with Windows based GUI code? In particular, it would be nice for the resource to focus on the MS API implementations and good program design with GUI's in mind.
 
How interesting! I'd love to learn more about your microcomputer designs. How did you implement them? At what scope did you do your design work? And so on ...

Anyway, there's a few different books for learning GUI programming depending on what you want to do.

If you're going to just write C/C++ code, then you probably want Programming Windows by Charles Petzold.

If you're using C++ and MFC, I'll unabashedly recommend my own book. It's OOP, but you can find it pretty readily on eBay.

If you're using C#, then you can decide between Programming Windows with C# from Petzold, or Chris Sells' book on WinForms.

There are many (many!) others in each category, but those are the ones that I'd recommend.

Using C/C++, by the way, might not get you the low-level access you're interested in. You can get pretty intimate with the RS-232 port using the user-mode Windows API, but the other ports aren't so exposed.
 
As an Amazon Associate, HardForum may earn from qualifying purchases.
Thanks for the links! I'll definitely check up on those.

I've got a proprietary windows driver hook from a camera manufacturer that gives me access to the firewire port that I need, and writing to the parallel port shouldn't be *too* terrible after that... though I'm willing to abandon that part if it becomes necessary.

My microcomputers are primarily 8051 derivatives. They're pretty simple, using SRAM and 82C55 port expanders for I/O. I basically put them together from conceptual design to completion. I did my own schematics by hand, then used FreePCB to do the layout. I printed and etched the circuit boards at home. I've posted a guide on how to do the etching at home if you're interested.
 
I just use Eagle and PCBExpress for boards. I'm more interested in what you're doing with the machines.

(I had hoped that you were doing lower-level design; I worked with the guy who runs www.fpgacpu.org and, after a trip to the Embedded Systems Conference, he almost had me convinced to start playing with FPGAs to develop my own CPUs. It looks like real fun.)

Anyway, if you've got your own drivers ready to go, I expect you're ready to start using CreateFile() and the IOCTL functions and going to town.
 
Nope, I'm afraid I'm not quite that low-level yet. I just graduated high school, give me a break! I'm thinking of going into materials science or chemistry... EE is lower down the list.

As far as uses:

1) using an ADNS-3080 from an optical mouse as a video camera
2) driving a line array as part of a homemade UV/VIS spectrophotometer
3) i2c interface
4) flash reader for dead flash drives and phones

and so on. Having hardware level control is pretty handy for all sorts of things!
 
kleptophobiac said:
So I figured my only real solution is C++. I need to be able to code fairly fast GUI based programs that have hardware level access (IEEE1394, RS232, EPP+ECP).

There is pretty much no such thing as "Coding fairly fast GUI programs" in C++. Your going to have to pick up a pretty nice 1,000 page book on the MFC, and mind you this is a BEAR to learn. What exactly is your objection to .NET? Check out C#, I think you will find that you will be able to do what your asking in about 1/10th of the time than with C++. And I believe Microsoft still has a free version of their IDE - C# 2005 Express or something to that effect. C++ as far as GUI based programs are concerned, is a dying language....
 
if you want to learn C++ I recommend you go over to www.3dbuzz.com and download their VTM's (Video Training Movies), they have C++ but they also have other VTM's for 3d modeling programs, game editors plus more.

You will have to register to download them though but its good to do so.

They also have DVD's that you can buy for Web Designing for like $100 but its worth it believe me.

Intro to C++ Free VTM's.

Web Design 1

Web Design II

Please read the rules on the site also.
 
GeeksFTW said:
C++ as far as GUI based programs are concerned, is a dying language....
Are you quoting a study, or just presenting your own observation?
 
OP makes me feel stupid lol keep up the learning tho, I like it.
 
Nah, don't worry, I've got plenty of other personal deficiencies to make up the difference!
 
Back
Top