I never understood why the test will lead to access violation when it starts; however, I am sure that I did something wrong.
To remove this error, I changed the structure of my Visual Studio solution so that most of the code was in a static library project (.lib) that would contain the implementation of my program. Thus, all classes and functions for my program in the project are automatically exported, so I do not need to use __declspec (dllexport).
Then I created a small Win32 console application that will create a .exe file for my program that references the .lib project. The goal of this project is to create an executable file for my program, so everything he needed was basic, which would cause the beginning of my code in the .lib project.
After that, I was able to easily start the Native Unit Test project by simply asking him to also link to the .lib project, and since then I have had no access errors.
source share