General information
Category:
Windows API functions
>Is it best to declare all api functions I will be using "up-front" in the app, or only declare them as I need to? I have a winapi class, and am declaring all my api functions in the class init code. I could move the individual declares to the appropriate methods but then the declare would execute each time the method was called. I am declaring a bunch of functions (roughly 20 or so). Any comments/suggestions?
Like anything, I think it is a matter of preference. In your situation, I would write a class that encapsulates the the API calls. Then, in your app, where you make those API calls - make method calls to your class instead. When the class is instanced, the Init() will take care of the declares. To make things easier, yoiu may want to instance the class at the top of your app.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only