How to step up the learning process? What to do next!!

i have been learning c++ for past 2 months. i have learned the basics ie- classes,structs,functions etc... and also made quiet a few beginner programs which uses algorithms and logics like binary and decimal converter, password generator , spell checker etc etc , but all in console cmdprmpt.
I want to make a program which has gui, any help on where or how to get started with it.
also i have seen codes where ->
1
2
#include <string>
#include "Data.hpp" 
this type libraries are used where "Data.hpp" is another file with code.
I mean is i want to move to intermediate level in c++. any help, directions, tips for that will be appreciated.

My primary aim is to make a CDR(call data record) analyzer software.A program which reads data from a excel file and rearranges it in given format
Install, learn a bit about, and start using a GUI library;
for example nana http://nanapro.org/en-us/
You don't say how you are learning C++ - but the book "Programming: Principles and Practice Using C++" by Bjarne Stroustrup uses FLTK to teach gui principles.

As an example of one way to read data from an excel file, consider (For Windows 7 & Office 2010):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#import "c:\\Program Files (x86)\\Common Files\\microsoft shared\\OFFICE14\\mso.dll" \
	rename( "RGB", "MSORGB" ) \
	rename( "DocumentProperties", "MSDocument") \
	rename( "SearchPath", "MSSearch")

#import "c:\\Program Files (x86)\\Common Files\\microsoft shared\\VBA\\VBA6\\VBE6EXT.OLB"

#import "c:\\Program Files (x86)\Microsoft Office\\Office14\\excel.exe" \
	rename( "DialogBox", "ExcelDialogBox" ) \
	rename( "RGB", "ExcelRGB" ) \
	rename( "CopyFile", "ExcelCopyFile" ) \
	rename( "ReplaceText", "ExcelReplaceText" )


#include <iostream>
#include <iomanip>
#include <string>
#include <fstream>

using namespace Excel;
using namespace std;

const string sname = "c:\\MyProgs\\Level_3_30.xlsm";	// Complete path name to Excel filter file

int main()
{
	const auto hr {CoInitializeEx(0, COINIT_MULTITHREADED)};

	if (FAILED(hr))
		return (cout << "Failed to initialize COM library. Error code = 0x" << hex << hr << endl), 1;

	_ApplicationPtr pXL;

	if (FAILED(pXL.CreateInstance("Excel.Application")))
		return (cout << "Failed to initialize Excel::_Application!" << endl), 2;

	_WorkbookPtr pBook;

	try {
		pBook = pXL->Workbooks->Open(sname.c_str());
	}
	catch (...) {
		pXL->Quit();
		return (cout << "Cannot open spreadsheet file " << sname << endl), 3;
	}

	pXL->PutVisible(0, FALSE);

	const _WorksheetPtr pWksheet {pXL->ActiveSheet};
	const RangePtr pRange {pWksheet->Cells};

	const int vSize {8};		// Size of vmin/vmax
	const int nRange {17};		// Number of ranges
	const int rRow {22};		// Number of rows per range
	const int rCol {3};		// Number of cols per range
	const int rcStart {8};		// H for starting col of first range
	const int rrStart {10};		// Starting row for the ranges

	int vMin[vSize] {0};
	int vMax[vSize] {0};
	int vPar[vSize] {0};
	int rData[nRange][rRow][rCol] {0};	// Contains the data for the various required ranges from the spreadsheet

	bool bad {false};	// Has data read failed

	try {
		for (int r = 1; r <= vSize; ++r) {	// Rows 1 to 8
			vMin[r - 1] = (int)pRange->Item[r][48];	// AV col
			vPar[r - 1] = (int)pRange->Item[r][25];	// Y col
			vMax[r - 1] = (int)pRange->Item[r][50];	// AX col
		}

		// Obtain the range data
		for (int r {0}; r < nRange; ++r)
			for (int cl {0}; cl < rCol; ++cl)
				for (int rw {0}; rw < rRow; ++rw)
					rData[r][rw][cl] = (int)pRange->Item[rrStart + rw][rcStart + (r * rCol) + cl];
	}
	catch (...) {
		bad = true;
	}

	pWksheet->Release();
	pBook->Release();
	pXL->Quit();

	if (bad)
		return (cout << "Cannot read the range data!" << endl), 4;
}

Last edited on
if you are using visual studio 2019, this is a getting started guide that at least builds a gui project (empty) as a first step. Then you can do something like put in an edit box and a button and make the button print hello world into the edit box.
http://y-okamoto-psy1949.la.coocan.jp/VCpp/OnVSCpp2019/en/

yes, you DO Have to close and reopen your project or it will not give you the dialog editor. It is some kind of bug in the product.

this is for 'winforms's, or some sort of subset of .net? It was unclear and I am not highly experienced in .net / managed code. Seems like some .net stuff has no editor at all that I can find and MFC is still in there but its 32 bit and I don't recommend it.
Last edited on
That is for c++/cli. Which is using .net with C++. Note that it uses 'extensions' to standard C++ (like boxing) to support managed code.
I am aware, I have so far avoided it like the covid but looks like I may have to invest in it a bit now. Seems simple enough if you let the robot generate 90% of the code ;)
The half-baked WYSIWYG editor is easier than MFC, don't need to add my own variables for an edit box anymore etc its just there ready to use.
Last edited on
Also possibly consider C++/winrt which is c++ for UWP.

See https://docs.microsoft.com/en-us/windows/uwp/cpp-and-winrt-apis/
Thanks JLBorges, seeplus and jonnin for the replies.
@seeplus i wasn't learning from any book , i used various tutorial websites and forums for that. now i am ordering the book recommended by you -"Programming: Principles and Practice Using C++" by Bjarne Stroustrup
Topic archived. No new replies allowed.