Information générale
Catégorie:
Fonctions Windows API
>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.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement