Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/ide/adding-a-method-visual-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ Add a method to an interface by using the add method wizard:

## See also

[Add an IDL method wizard](add-interface-definition-library-method-wizard.md)\
[Add an IDL MFC method wizard](../mfc/reference/add-idl-mfc-method-wizard.md)\
[Adding functionality with code wizards](adding-functionality-with-code-wizards-cpp.md)
2 changes: 1 addition & 1 deletion docs/intrinsics/vmx-on.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: "Learn more about: __vmx_on"
title: "__vmx_on"
ms.date: 04/14/2022"
ms.date: 04/14/2022
f1_keywords: ["__vmx_on"]
helpviewer_keywords: ["VMXON instruction", "__vmx_on intrinsic"]
ms.assetid: 16804991-6a75-4adf-8ec2-bc95acfa4801
Expand Down
3 changes: 2 additions & 1 deletion docs/mfc/reference/add-idl-mfc-method-wizard.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,5 @@ The following section describes the Add IDL MFC Method wizard UI:
## See also

[Add method wizard](../../ide/adding-a-method-visual-cpp.md)\
[MFC wizards and dialog boxes](mfc-wizards-and-dialog-boxes.md)
[Add an IDL method wizard](../../ide/add-interface-definition-library-method-wizard.md)\
[MFC wizards and dialog boxes](mfc-wizards-and-dialog-boxes.md)
23 changes: 11 additions & 12 deletions docs/mfc/reference/adding-an-mfc-class-from-a-type-library.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
---
description: "Learn more about: Adding an MFC Class from a Type Library"
title: "Adding an MFC Class from a Type Library"
ms.date: "03/21/2022"
description: "Learn more about: Adding an MFC class from a type library using a Microsoft Visual Studio wizard"
title: "Add an MFC class from a type Library"
ms.date: 04/14/2022
helpviewer_keywords: ["classes [MFC], adding MFC", "MFC, adding classes from type libraries", "type libraries, adding MFC classes from"]
ms.assetid: aba40476-3cfb-47af-990e-ae2e9e0d79cf
ms.custom: devdivchpfy22
---
# Adding an MFC Class from a Type Library
# Add an MFC class from a type library

Use this wizard to create an MFC class from an interface in an available type library. You can add an MFC class to an [MFC application](../../mfc/reference/creating-an-mfc-application.md), an [MFC DLL](../../mfc/reference/creating-an-mfc-dll-project.md), or an [MFC ActiveX control](../../mfc/reference/creating-an-mfc-activex-control.md).
Use this wizard to create an MFC class from an interface in a type library. You can add an MFC class to an [MFC application](../../mfc/reference/creating-an-mfc-application.md), an [MFC DLL](../../mfc/reference/creating-an-mfc-dll-project.md), or an [MFC ActiveX control](../../mfc/reference/creating-an-mfc-activex-control.md).

> [!NOTE]
> You don't need to create your MFC project with Automation enabled to add a class from a type library.

A type library contains a binary description of the interfaces exposed by a component, defining the methods along with their parameters and return types. Your type library must be registered for it to appear in the **Available type libraries** list in the Add Class from Typelib Wizard.
A type library contains a binary description of the interfaces exposed by a component, defining the methods along with their parameters and return types. Your type library must be registered for it to appear in the **Available type libraries** list in the wizard.

### To add an MFC class from a type library
## Add an MFC class from a type library

1. In either **Solution Explorer** or [Class View](/visualstudio/ide/viewing-the-structure-of-code), right-click the name of the project to which you want to add the class.

1. From the shortcut menu, select **Add**, and then select **New Item**.
1. From the shortcut menu, select **Add** > **New Item**.

1. In the **Add New Item** dialog, select **Installed** packages and then select **Visual C++**.

1. In the Templates pane, select **MFC Class from Typelib**, and then select **Add** to display the [Add Class from Typelib Wizard](../../mfc/reference/add-class-from-typelib-wizard.md).

In the wizard, you can add more than one class in a type library. Likewise, you can add classes from more than one type library in a single wizard session.
Using the wizard, you can add more than one class in a type library. You can add classes from more than one type library in a single wizard session.

The wizard creates an MFC class, derived from [COleDispatchDriver](../../mfc/reference/coledispatchdriver-class.md), for each interface you add from the selected type library. `COleDispatchDriver` implements the client side of OLE automation.
The wizard creates an MFC class derived from [`COleDispatchDriver`](../../mfc/reference/coledispatchdriver-class.md), for each interface you add from the selected type library. `COleDispatchDriver` implements the client side of OLE automation.

## See also

[Automation Clients](../../mfc/automation-clients.md)<br/>
[Automation Clients](../../mfc/automation-clients.md)\
[Automation Clients: Using Type Libraries](../../mfc/automation-clients-using-type-libraries.md)
48 changes: 45 additions & 3 deletions docs/standard-library/steady-clock-struct.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: "Learn more about: steady_clock struct"
title: "steady_clock struct"
ms.date: 08/19/2021
ms.date: 04/14/2022
f1_keywords: ["chrono/std::chrono::steady_clock"]
---
# `steady_clock` struct
Expand All @@ -16,12 +16,54 @@ struct steady_clock;

## Remarks

A `steady_clock` is a monotonic clock, which means that time only moves forward. A `steady_clock` ensures that the time between clicks doesn't vary, making it better for measuring intervals than using a system clock that provides wall-clock time. The problem with using wall-clock time to measure elapsed time is that the wall-clock time may get modified while measuring an interval. It could be modified by synchronizing with another clock over the network, adjusting the time for daylight savings time, and so on. A `steady_clock` isn't subject to these adjustments, making it the preferred way to keep track of elapsed time.
A `steady_clock` is a monotonic clock, which means that the time it reports only moves forward. The value returned by a call to `now` is always less than or equal to the value that is returned by the next call to `now`.

The value that is returned by a first call to `now` is always less than or equal to the value that is returned by the next call to `now`.
A `steady_clock` ensures that the time between ticks is constant, making it better for measuring intervals than using a system clock. The system clock provides wall-clock time. The problem with using wall-clock time to measure elapsed time is that wall-clock time may get modified while measuring a time interval. It could be modified by synchronizing with another clock over the network, by a transition to daylight savings time, and so on. A `steady_clock` isn't subject to these adjustments, making it the preferred way to keep track of elapsed time.

`high_resolution_clock` is a typedef for `steady_clock`. On Windows, `steady_clock` wraps the `QueryPerformanceCounter` function.

## Example

```cpp
#include <chrono>
#include <thread>
#include <iostream>

using namespace std::chrono;

int main()
{
auto begin = steady_clock::now();
std::this_thread::sleep_for(std::chrono::seconds(1));
auto end = steady_clock::now();

std::cout << "Elapsed seconds: "
<< duration_cast<seconds>(end - begin).count()
<< "s\n";

std::cout << "Elapsed milliseconds: "
<< duration_cast<milliseconds>(end - begin).count()
<< "ms\n";

std::cout << "Elapsed microseconds: "
<< duration_cast<microseconds>(end - begin).count()
<< "us\n";

std::cout << "Elapsed nanoseconds: "
<< duration_cast<nanoseconds>(end - begin).count()
<< " ns\n";

return 0;
}
```

```Output
Elapsed seconds: 1s
Elapsed milliseconds: 1007ms
Elapsed microseconds: 1007266us
Elapsed nanoseconds: 1007266700 ns
```

### Convenience type aliases

|Name|Description|
Expand Down