You can manually load the nrfjprog DLL when the application is running.
This method provides more flexibility than build-time loading by allowing you to
load a limited set of DLL functions. In addition, it allows more complex mechanisms for
finding the library file. Manual loading also prevents the DLL from “polluting” the
global name space with function names.
The following platform-specific code snippets describe how to load and call one function of the nrfjprog DLL. Remember that error checking should be done in each step of the code, but for simplicity this is not illustrated in the following code snippets.