It seems that calling a P-Invoke while the App is not completed loaded make it spew the errors of the related functions.
For example at the moment I'm trying to load at startup various DLL through LoadLibrary and test if they have exported a particular function.
If I do that while the app completed its load procedure no error are given (just the result is 0 and I can check them through GetLastError), If I do it at startup time (for example the Load event of the form) it spews the errors (for example a missing module etc..).
There is a way to mute those errors?
Note that these are not exceptions, but system messageboxes and try...catch does not work here.
Thanks.