Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Multiple declares?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00587915
Message ID:
00587978
Views:
33
Thanks George that really spell it out nicely.

>>Thanks George and Hilmar - Well that's covered both possibilities quite nicely and given me some things to think about :)
>>
>>Anyone want to cast a deciding vote?
>
>You should.< s >
>
>I'm really being serious here. You know your own work and methodology far better than anyone here could possibily know it. All you have to do is consider the possibilities and the potential problems under the circumstances that the code is going to have to use. Let's just briefly sum this up.
>
>1. Declare all DLLs in the Init event of the object.
>
>Pros - No additional overhead by having to declare them again.
>
>Cons - If some where in code the CLEAR DLLS command is issued, any subsequent calls to any of the methods referencing the API call will fail.
>
>2. Declare DLLs only in the code that uses them.
>
>Pros - Calls will not fail if CLEAR DLLS is issued.
>
>Cons - Additional overhead of declaring the DLL if the routine is called multiple times.
>
>My choice is both. It depends on the usage of the call. If I know that multiple calls to the particular function are required and the code is unlikely to be interrupted by an event, I'll declare it in one place. Otherwise, I declare as needed.
Caroline
Previous
Reply
Map
View

Click here to load this message in the networking platform