Extract tar.gz Files in Windows 10

Method taken directly from https://pureinfotech.com/extract-tar-gz-files-windows-10/ (I’ve added nothing new)

Open Command Window (two of many ways):

  1. LMB on Win → Windows System → Command Prompt

This will open the command window:

2. LMB on [Win] then type “cmd”

Press [Enter] to start command window

Extract file (two of many ways):

  1. Type: “cd <path>” change to directory containing tar.gz file:

Type: “tar -xvzf <filename.tar.gz>” to extract file to that directory:

2. Type “tar -xvzf <file path/filename.tar.gz> -C <target path>” to extract file into target path:

Note: this did not work with folder name “TensorFlow Model” but did once the folder was renamed “TensorFlow_Model”

Creating a simple MFC project in VS 2019 from scratch.

I wanted to learn how to create a stripped-down MFC project in Visual Studio 2019 (VS) that does not use the document/view architecture, but all of the tutorials on-line–at least the ones I found–were for earlier versions of VS and the menus have been restructured since that version.

I’m often frustrated when software companies rearrange menus in their products but do not update the tutorials. This makes learning new software unnecessarily harder.

This tutorial demonstrates how I was able to create a bare-bones MFC project in VS 2019.

First, my version of VS,
Microsoft Visual Studio Community 2019, Version 16.0.3
Microsoft .NET Framework, Version 4.7.03056

Create Project:

From, File → New → Project – will open Create new project dialog:

From the “Language” menu, choose C++.

Select [Empty Project] then [Next] Configure your new project dialog will open:

Enter project name and select project folder location.
Left mouse button (LMB) on [Create] – this will create an empty project.

Once the project is created, the Solution Explorer should look like this:

Configure Project:

In Solution Explorer, right mouse button (RMB) on project name–“HelloWorld” in this case–and select Properties from menu Properties Page dialog will open:

Select Configuration Properties → General and set Project Defaults → Use of MFC = “Use MFC in Static Library”.

Select Configuration Properties → Linker → System and set SubSystem = “Windows (/SUBSYSTEM::WINDOWS)”

LMB on [OK] to apply changes and exit dialog.

Create Source File:

From Solution Explorer panel:

RMB on “Source Files” in Solution Explorer

Select Add → New Item from context menu

Select [C++ File (.cpp)], enter Name–in this case “Main.cpp”–and then [Add].

This will create an empty source file.

Copy the following code into the empty file,

#include <afxwin.h>
#include "Main.h"

CMyApp myApp;

BOOL CMyApp::InitInstance()
{
	m_pMainWnd = new CMainWindow;
	m_pMainWnd->ShowWindow(m_nCmdShow);
	m_pMainWnd->UpdateWindow();
	return TRUE;
}

BEGIN_MESSAGE_MAP(CMainWindow, CFrameWnd)
	ON_WM_PAINT()
	END_MESSAGE_MAP()

CMainWindow::CMainWindow()
{
	Create(NULL, _T("The Hello"));
}

void CMainWindow::OnPaint()
{
	CPaintDC dc(this);

	CRect rect;
	GetClientRect(&rect);
	
	dc.DrawText(_T("Hello"), -1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
}

Create Header File:

From the Solution Explorer panel:

RMB on “Header Files” in Solution Explorer

Select Add → New Item from context menu

Select [Header File (.h)], enter Name–in this example, “Main.h”–and then [Add].

This will create an empty header file.

Copy the following code to that file,

#pragma once
#include <afxwin.h>


class CMyApp : public CWinApp
{
public:
	virtual BOOL InitInstance();
};

class CMainWindow : public CFrameWnd
{
public:
	CMainWindow();
protected:
	afx_msg void OnPaint();
	DECLARE_MESSAGE_MAP()
};

Press Ctrl+Shift+s to save all files in project.

Press Ctrl+F5 to compile and run.

After the program has compiled, the hello world program window should open:

If the program does not compile, then I’m sorry, but I’ve just done to you what has been done to me so many times. The good news is that by figuring out what went wrong, you will learn far more about VS, MFC, and C++ than you would have if it had worked the first time.

Design a site like this with WordPress.com
Get started