Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ShellExcute Declared Functions
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00487449
Message ID:
00491598
Views:
8
Thanks Ed.

Mathias

>>I am firing up a browser (explorer) using a declared shellExcute. It seems to open the site almost instantly the first time. But the if I close explorer and up it up again, there is a definite delay. The more i repeat this sequence the longer the delay. What becomes of these DLL Declared functions / objects once they are no longer in use?
>>
>
>This has nothing to do with the ShellExecute() declaration, but more likely is related to fragmentation of the Windows memory address space, and the possibility that the first ShellExecute() engages an already running instance of the Browser - you close it, and the next time, since there's no running instance to engage, is forced to load a new instance of IE in its entirety.
>
>If you know that you're going to launch a document serviced by the browser repeatedly, why not instance a Web Browser control once and handle all references to documents serviced by the browser through it, or if operating outside a Form environment, instance the InternetExplorer.Application object and use it to service all calls - once it's instanced, it's already loaded, it's visibility can be controlled programmatically, and less fragmentation of Windows resources will occur, since the process of allocate/load/deallocate a new server doesn't constantly take place. It's faster to navigate to a new document or URL if the Explorer is already instanced than it is to check the registry, determine what app is responsible for the ShellExecute() reference, start the server (in this case, Explorer) and then navigate to the required document or URL. While keeping an instance running will consume some memory that might be released if the instance unloads between calls, there's little
>disadvantage to keeping the server reference around at all times, and if you are repeatedly referencing the same server throughout your app's life, reusing a single common instance may offer better performance and OS resource management than repeatedly instantiating it.
Mathias Banda

Time is longer than a rope.
Previous
Reply
Map
View

Click here to load this message in the networking platform