I'm assuming d3d11.dll won't exist if you don't have a DirectX 11 gfx card/driver installed ? I can use delayed loading to mitigate the problem, but I'll still get a runtime error when I try and call D3D11CreateDevice and it doesn't exist.
For a simple C API I could use LoadLibrary to dynamically bind APIs at run time e.g. for imagehlp.dll:
hImagehlpDll = LoadLibraryA( "imagehlp.dll" ); if ( hImagehlpDll == NULL ) return 0;//DLL not found gracefully exit //Bind functions as C callback functions that can then be used as if they were statically linked C functions pSGLFA = (tSGLFA) GetProcAddress( hImagehlpDll, "SymGetLineFromAddr" ); //Execute the function pSGLFA( hProcess, (DWORD)addrPC, &offsetFromSymbol, &Line )
But how do I do this for a complicated C++ API like DirectX 11 ?