 |
LoadResource Add comment W32 Constants Translate this page |
 |
 |
|
The LoadResource function loads the specified resource into global memory. |
 |
 |
| Code examples: |
 |
|
|
 |
 |
| Declaration: |
 |
 |
HGLOBAL LoadResource(
HMODULE hModule,
HRSRC hResInfo
);
|
 |
 |
 |
| FoxPro declaration: |
 |
 |
DECLARE INTEGER LoadResource IN kernel32;
INTEGER hModule,;
INTEGER hResInfo
|
 |
 |
 |
| Parameters: |
 |
hModule
[in] Handle to the module whose executable file contains the resource.
hResInfo
[in] Handle to the resource to be loaded. This handle is returned by the FindResource or FindResourceEx function. |
 |
 |
| Return value: |
 |
| If the function succeeds, the return value is a handle to the data associated with the resource. |
 |
 |
| My comment: |
 |
If hModule is NULL, the system loads resource from the module that was used to create current process.
* * *
I am thinking about approaches to design of VFP application with auto-updateable executable, the master copy of which is stored on a web server. Definitely I am not the first person doing this -- read Rick Strahl`s article Automatic Application Updates over the Web with Visual FoxPro 7.0 -- so my thoughts may not be precisely original.
Normally Windows executable can not update itself. That means it needs help from another process; let`s call this one the Updating Process.
Six tasks for UP to get done:
- connect to the web server and check for updates
- check and terminate all processes originated from the main executable, ME
- download new version of ME from the web server
- overwrite ME
- restart ME
- terminate itself
For reasons of mobility UP executable can be stored as a binary resource inside ME. It is doable. ME can use something like LoadResource plus CopyMemory plus STRTOFILE() plus CreateProcess to invoke UP.
|
 |
 |
| Word Index links for the LoadResource : |
 |
|
|
 |
 |
| Translate this page: |
 |
|
 |
 |
| • |
 |
| Created: | 2003-05-16 10:21:55 | | Modified: | 2006-01-17 20:17:00 | Visited in last 7 days: 17 |