>Local lcFolder >m.lcFolder = Justpath(Sys(16)) >Set Default To (m.lcFolder) > >* Init Vfp2c32 >Set Library To vfp2c32 > >#INCLUDE vfp2c.h >If !InitVFP2C32(VFP2C_INIT_ALL) > Local laError[1], lnCount, xj, lcError > lnCount = AERROREX('laError') > lcError = 'VFP2C32 Library initialization failed:' + Chr(13) > For xj = 1 To lnCount > lcError = lcError + ; > 'Error No : ' + Transform(laError[1]) + Chr(13) + ; > 'Function : ' + laError[2] + Chr(13) + ; > 'Message : "' + laError[3] + '"' > Endfor > && show/log error and abort program initialization .. > Messagebox(m.lcError,16,"Error") > Return >Endif > >#Define LOAD_LIBRARY_AS_IMAGE_RESOURCE 0x00000020 >#Define LOAD_LIBRARY_AS_DATAFILE 0x00000002 > >* http://msdn.microsoft.com/en-us/library/windows/desktop/ms684179%28v=vs.85%29.aspx >Declare Integer LoadLibraryEx In Win32api ; > String lpFileName, ; > Integer hFile, ; > Integer dwFlags > >* http://msdn.microsoft.com/en-us/library/windows/desktop/ms683152%28v=vs.85%29.aspx >Declare Integer FreeLibrary In Win32api ; > Long hModule > >Local lcResourceFile, lnhModule >m.lcResourceFile = Addbs(m.lcFolder) + "Office2007.dll" > >m.lnhModule = LoadLibraryEx(m.lcResourceFile, 0, LOAD_LIBRARY_AS_IMAGE_RESOURCE + LOAD_LIBRARY_AS_DATAFILE) >If m.lnhModule > 0 > > * > Local lcResources, laResourceTypes[1], lnResourceType, laResources[1], lnResource > m.lcResources = "" > If AResourceTypes("laResourceTypes", m.lnhModule) > 0 > For m.lnResourceType=1 To Alen(m.laResourceTypes) > m.lcResources = m.lcResources + Chr(13) + Chr(10) + ; > "Resource type: " + ; > Alltrim(Transform(m.laResourceTypes[m.lnResourceType])) + ; > Chr(13) + Chr(10) > If AResourceNames("laResources", m.lnhModule, m.laResourceTypes[m.lnResourceType]) > 0 > For m.lnResource=1 To Alen(m.laResources) > m.lcResources = m.lcResources + ; > "Resource name: " + ; > Alltrim(Transform(m.laResources[lnResource])) + ; > Chr(13) + Chr(10) > * Save each resource here... > Endfor > Endif > Endfor > _Cliptext = m.lcResources > Endif > * > > If FreeLibrary(m.lnhModule) <> 0 > Else > ? "Error releasing library..." > Endif >Else > ? "Error loading library..." >Endif > >Release Library vfp2c32 > >Clear Dlls LoadLibraryEx >Clear Dlls FreeLibrary >