I am writing an application that gets its dimensions from the paper ratio of the default printer of the local computer. This all works well unless the default printer is over a VPN. When this is the case, calling GetDefaultPrinter() takes too long. I need to find a way to put a time constraint on GetDefaultPrinter() and if it exceeds that constraint, break out of the function. 开发者_如何学C
Any possible solutions would be great.
Thanks,
Ian
Would putting this sort of functionality into a separate thread be acceptable?
精彩评论