Good morning,
I wouldl like to ask your help; I am trying to link a dll library explicltly.
I use windows, in visual studio have created a new empty project, added a source file, changed its extension to .c, and written the following code:

Code:

#include <stdio.h>

#include <windows.h>


int main()
{
    
       HANDLE hDLL = LoadLibrary("Library.dll");

        if (hDLL == NULL)
            
        {
                printf("Failed to load the library.\n");
        }
                    
        else
        
        {            
                printf("Library loaded.\n");
        }
}
I can build the project and execute it but always I get the output "failed to load the library". I tried to copy the dll library in every possible directory inside the visual studio project but the result is always the same.

I would like to ask you how can I get some hints (i.e.: a more useful error message) about why it is not possible to load the library.

thank you,
Alberto