Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Registry.prg - CLASS filereg's GetAppPath PROCEDURE
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00661519
Message ID:
00661816
Vues:
32
Small correction
      lnCharReturned = ExpandEnvironmentStrings(m.lpbData, @lcExpandedString, 1000)
*      m.lpbData = m.lcExpandedString
      m.lpbData = LEFT(m.lcExpandedString, lnCharReturned-1)
You can also use WSH
oShell = CreateObject("WScript.Shell")
m.lpbData = oShell.ExpandEnvironmentStrings(m.lpbData)
>
>After a search on MSDN I found the ExpandEnvironmentStrings function.
>
>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/sysinfo_4ysz.asp
>
>I added the Declare to the LoadRegFuncs procedure
>
>  DECLARE LONG ExpandEnvironmentStrings IN Win32API ;
>    STRING cSrc, STRING @cDst, LONG nSize
>
>
>Modified the GetKeyValue procedure
>
>* wrd-bds - 05/27/2002 added code to expand REG_EXPAND_SZ value types
>  DO CASE
>    CASE lpdwType = REG_EXPAND_SZ
>      LOCAL lcExpandedString,lnCharReturned
>      lcExpandedString = SPACE(1000)
>      lnCharReturned = ExpandEnvironmentStrings(m.lpbData, @lcExpandedString, 1000)
>      m.lpbData = m.lcExpandedString
>
>    CASE lpdwType # REG_SZ
>      RETURN ERROR_NONSTR_DATA
>
>  ENDCASE
>
>* Make sure we have a data string data type
>*!*      IF lpdwType # REG_SZ
>*!*        RETURN ERROR_NONSTR_DATA
>*!*      ENDIF
>
>
>And I am good to go.
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform