In all my classes never taught us how to us C++

I still don't know how to put it to use

My professors taught us how to write it, but now how to use it

every program we wrote would excute some programming by inputing data or outputing data on a black "DOS" looking screen.

1. What are some of the modern day uses of C++?

2. How do you create a real application that is installed on your PC, where a GUI uses C++ to manipulate a Windows Operation System? Or is just for backend use?

3. How can I create an application that is meant to be used in a LAN Environment. Example below (client/server):

End User -> PC Hardware (i.e. Keyboard, Mouse & Monitor) -> GUI -> Processes/Executes C++ Code -> <- Data Transport Median -> Server Stores Data and Executes Code

^^^Hope that made any sense :-|

Recommended Answers

All 7 Replies

Technically C++ and XP/98 Linux OSX Unix are not an intregal part of one another. C++ is just merely a tool by which you can write applications for many platforms. The scope an purpose to your classes would have been gaining knowledge how to use the language effectively. Just because you are shown how to use a circular saw doesn't make you a carpenter, but you may be the best circular saw user on the planet.

If you are interested in designing GUI applicaitons for windows, now you must study a book such as WIN32 API Superbible. Once you understand all the functions that are part and parcel of the operating enviorment of interest, maybe even OSX, Linux, Unix, Gnome, KDE and so on, then you will be on your way marrying C++ with end user applications.

Learning an operating systems API can be as ownerous as learning C++. Here is an example of a skeletal windows app.

#define WIN32_LEAN_AND_MEAN
 
#include <windows.h>
 
HINSTANCE hInst;
 
HWND MainWnd;
 
const char *AppName = "OLIST", *AppTitle = "Order List Lookup";
 
static bool CreateMainWindow (int ShowValue);
 
LRESULT CALLBACK MainWndProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
 
// =========================================================================================
 
int APIENTRY WinMain (HINSTANCE Instance, HINSTANCE PrevInst, char *CmdLine, int ShowValue)
 
{
 
MSG Msg;
 
Msg.wParam = -1;
 
hInst = Instance; // Global copy of instance handle.
 
if (CreateMainWindow (ShowValue))
 
{
 
while (GetMessage (&Msg, NULL, 0, 0))
 
{
 
TranslateMessage (&Msg);
 
DispatchMessage (&Msg);
 
}
 
}
 
return Msg.wParam;
 
}
 
// -------------------------------------------------------------------------------------------
 
static bool CreateMainWindow (int ShowValue)
 
{
 
const UINT STYLE = WS_SYSMENU | WS_MINIMIZEBOX | WS_SIZEBOX;
 
const UINT EX_STYLE = WS_EX_CLIENTEDGE;
 
WNDCLASSEX Wc;
 
Wc.cbSize = sizeof WNDCLASSEX;
 
Wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
 
Wc.lpfnWndProc = WNDPROC (MainWndProc);
 
Wc.cbClsExtra = 0;
 
Wc.cbWndExtra = 0;
 
Wc.hInstance = hInst;
 
Wc.hIcon = 0;
 
Wc.hCursor = LoadCursor (NULL, IDC_ARROW);
 
Wc.hbrBackground = HBRUSH (COLOR_BTNFACE + 1);
 
Wc.lpszClassName = AppName;
 
Wc.lpszMenuName = NULL;
 
Wc.hIconSm = 0;
 
if (RegisterClassEx (&Wc))
 
{
 
SIZE Wnd;
 
// Determine windows size based on current resolution. 38% width 75% height.
 
Wnd.cx = GetSystemMetrics (SM_CXSCREEN) >> 1;
 
Wnd.cx -= Wnd.cx >> 2;
 
Wnd.cy = GetSystemMetrics (SM_CYSCREEN);
 
Wnd.cy -= Wnd.cy >> 2;
 
MainWnd = CreateWindowEx (EX_STYLE, AppName, AppTitle, STYLE,
 
CW_USEDEFAULT, CW_USEDEFAULT, Wnd.cx, Wnd.cy,
 
NULL, NULL, hInst, NULL);
 
if (MainWnd)
 
return true; 
 
}
 
return false; // Default return value, function failed.
 
}
 
// -------------------------------------------------------------------------------------------
 
LRESULT CALLBACK MainWndProc (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
{
 
switch (Msg)
 
{
 
// ________________________________________________________________________________
 
case WM_CREATE:
 
ShowWindow (hWnd, SW_NORMAL);
 
break;
 
// ________________________________________________________________________________
 
case WM_DESTROY:
 
PostQuitMessage (0);
 
break;
 
// ________________________________________________________________________________
 
default:
 
return DefWindowProc (hWnd, Msg, wParam, lParam);
 
}
 
return 0; // Default value for applciation handled messages.
 
}

I apologize for the formatting. I'm still trying to figure out the best way to copy and paste code so it will look good in this code frame

I will be studying this closely, thanks a lot. I going to get that book, or find something online just like it.

Have you tried copying your code from Notepad?

I think I've tried notepad before, but for some reason I think I used WordPad to save to a TXT file and then loaded with Notepad and copied and pasted from there. So far that is the only way I've been able to pad blanks instead of tabs.

In code snippets 1o0oBhP posted another example of a skeletal GUI app
http://www.daniweb.com/code/snippet112.html

>every program we wrote would excute some programming by inputing data
>or outputing data on a black "DOS" looking screen.
I make a good living doing just that. In fact, I've never written a GUI or any graphical component. It's funny how everyone seems to think that they're not really programming unless pretty pictures are involved.

1) Just about anything you can think of. C++ is a popular workhorse in the computer world.

2) By learning a graphical API and writing an event driven messaging overlay of the code that does real internal processing. Your question is dreadfully vague.

3) TCP/IP is where it's at for networking. Do a google search for "beej" and see where that takes you.

>every program we wrote would excute some programming by inputing data
>or outputing data on a black "DOS" looking screen.
I make a good living doing just that. In fact, I've never written a GUI or any graphical component. It's funny how everyone seems to think that they're not really programming unless pretty pictures are involved.

1) Just about anything you can think of. C++ is a popular workhorse in the computer world.

can you give some examples of what you do, real life examples though. Be careful, I'm setting you up for a more specific question later ;)

>can you give some examples of what you do
I have a hand in just about everything that involves custom coding where I work. Most often I find myself upgrading our terminal software with new functionality, writing and editing code for report filtering, maintaining retail level software connectivity with central servers, addressing bug reports from everywhere, and mentoring the grunts. ;)

>can you give some examples of what you do
I have a hand in just about everything that involves custom coding where I work. Most often I find myself upgrading our terminal software with new functionality, writing and editing code for report filtering, maintaining retail level software connectivity with central servers, addressing bug reports from everywhere, and mentoring the grunts. ;)

lol@the grunts

*thinks about how lucky you are and sighs*

hey i printed out Beej's Guide and I will be reading it over pretty soon, i gotta get through this pointer and string tutorial i got from dave first. I told you this site was going to be a second home for me. And we're all roomies yeaaaaaaaaaaaaaaaaaaaaaaaah :lol:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.