With the release of .NET 7, a new and exciting feature has been introduced - the Native AOT (Ahead of Time). This feature involves compiling an application's code into native machine code before it's executed. That is quite the difference from regular .NET compiled code!
One of the great advantages of using Native AOT in C++ is the ability to leverage the functionality written in C#. For example, with the use of System.Text.Json, developers can easily serialize and deserialize data in their C++ applications. In this tutorial, we will walk through a simple example of how to use this powerful feature to enhance the functionality of your C++ applications.
Sending data, be it a simple string or object(s) to a completely different application was easier than anticipated. While I was working on an application I actually encountered an instance where I was required to re-authenticate the user in a separate application, as I do not want to prompt the user to, once again sign in. I had several ideas of either storing the token on the user his system or why not create a static entry point and just overwrite the string from memory.
Apparently there was a much easier solution... Today we discuss MemoryMappedFile