Skip to Main Content
.NET Core 2.0 By Example
book

.NET Core 2.0 By Example

by Neha Shrivastava, Rishabh Verma
March 2018
Beginner to intermediate content levelBeginner to intermediate
458 pages
10h 34m
English
Packt Publishing
Content preview from .NET Core 2.0 By Example

Interop with existing native libraries with example

Let's create DLL and create a header file (.h) inside it using C++, and we will see how we can consume it in our .NET Core application. In the following example, we created a DLL project for example, calling it ExampleDLL. Create a source .cpp file and a header file. Open the header file and write the following code, which returns the sum of two values. To consume public data and functions in class, we have to add the keyword _declspec(dllexport) before the public member which we want to consume from outside. While creating a DLL, we usually add the header file which contains the function or class prototype and we can export this using the __declspec(dllexport) keyword, while doing a declaration ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET Core 3 and React

ASP.NET Core 3 and React

Carl Rippon
Enterprise Application Development with C# 9 and .NET 5

Enterprise Application Development with C# 9 and .NET 5

Ravindra Akella, Rishabh Verma, Arun Kumar Tamirisa, Suneel Kumar Kunani, Bhupesh Guptha Muthiyalu

Publisher Resources

ISBN: 9781788395090Supplemental Content