Today one of my customers pointed me to this issue. I am calling Win32 in order to enable HiDPI support for a windows app.
I do this within try…end try exception handling but on program start he still recieves this error message on Windows without HiDPI support (Win2003 Server).
Any clue why try… end try does not catch this error?
try
dim b as Boolean = false
// enable HiDPI
Declare Function SetProcessDPIAware Lib "user32" () As Boolean
b = SetProcessDPIAware
catch
Finally
end try
#endif[/code]
The error is the requested function is not available on the system.
That’s why soft declaring it permits the application to run at least.
Then, using the IsFunctionAvailable() method you can check if the system support it and if so proceeding calling the function.