Using Win32 functions in Visual FoxPro Image Gallery
Resource
..msdn
BeginUpdateResource
CopyImage
EndUpdateResource
FindResource
LoadImage
LoadResource
LoadString
LockResource
SizeofResource
UpdateResource
Code examples:
Exporting DLL icon resources as .ICO files
Storing registration key in the resources of an executable file
LoadResource
    Add comment     W32 Constants      Translate this page
The LoadResource function loads the specified resource into global memory.
Code examples:
Storing registration key in the resources of an executable file
Exporting DLL icon resources as .ICO files
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:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2003-05-16 10:21:55
Modified: 2006-01-17 20:17:00
Visited in last 7 days: 16
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.156.92.243)
11 sec.Function: 'CharUpper'
Function group: 'String'
25 sec.Function: 'gethostname'
Function group: 'Windows Sockets 2 (Winsock)'
36 sec.Function: 'GdipNewInstalledFontCollection'
Function group: 'GDI+ Font'
47 sec.Example: 'GDI+: sending image of FoxPro form to printer'
1 min.Function: 'StrFormatByteSize'
Function group: 'String'
1.17 min.Function: 'AVIFileGetStream'
Function group: 'Windows Multimedia'
1.35 min.
Function group: 'GDI+ StringFormat'
1.53 min.Function: 'DrawDibDraw'
Function group: 'Windows Multimedia'
1.73 min.Function: 'NetScheduleJobEnum'
Function group: 'Network Management'
1.93 min.Function: 'GdipDeleteFontFamily'
Function group: 'GDI+ Font'
Google
Advertise here!