angelleynes
Programmer
I have the following procedure written in Visual Foxpro
but it's not saving the file name. can anyone please help.
thanks in advace!
***************************************
PROCEDURE SetPDFReg
***************************************
LPARAMETERS tcsize
DECLARE Integer RegOpenKeyEx IN Win32API ;
Integer hKey, String lpSubKey, Integer Reserved, ;
Integer samDesired, Integer @phkHandle
DECLARE Integer RegSetValueEx IN Win32API ;
Integer hKey, String lpszValueName, Integer dwReserved,;
Integer fdwType, String lpbData, Integer cbData
DECLARE Integer RegCloseKey IN Win32API ;
Integer nHKey
#DEFINE KEY_SET_VALUE 2
#DEFINE KEY_QUERY_VALUE 1
#DEFINE HKEY_CURRENT_USER -2147483647
#DEFINE REG_SZ 1
lHandle=0
adobe_key='Software\Adobe\Acrobat PDFWriter'+CHR(0)
result=RegOpenKeyEx(HKEY_CURRENT_USER, adobe_key,0,;
KEY_SET_VALUE, @lHandle)
IF result!=0 && it had an error
MESSAGEBOX('Error accessing registry!',16,'Rekon95')
RETURN
ENDIF
invalue="0"+CHR(0)
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'bdocinfo',0,REG_SZ, invalue,invaluesize)
invalue="1"+CHR(0)
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'bembedallfonts',0,REG_SZ, invalue,invaluesize)
invalue="0"+CHR(0)
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'bexecviewer',0,REG_SZ, invalue,invaluesize)
invalue="0"+CHR(0)
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'bsubsettruetype',0,REG_SZ, invalue,invaluesize)
invalue="0"+CHR(0)
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'bsubsettype1',0,REG_SZ, invalue,invaluesize)
invalue=k_drive+':\rekon\prints\'+RIGHT(DTOS(DATE()),6)+"_"+tcSize
IF FILE(invalue+'.PDF')
adder=65
DO WHILE FILE(invalue+"_"+CHR(adder)+".PDF"
adder=adder+1
ENDDO
invalue=invalue+"_"+CHR(adder)+".PDF"
ELSE
invalue=invalue+".PDF"
ENDIF
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'pdffilename',0,REG_SZ, invalue,invaluesize)
invalue=m_oper+CHR(0)
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'szAuthor',0,REG_SZ, invalue,invaluesize)
invalue="Rekon95"+CHR(0)
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'szCreator',0,REG_SZ, invalue,invaluesize)
result=RegCloseKey(lHandle)
IF result!=0 && it had an error
MESSAGEBOX('Error closing registry!',16,'Rekon95')
RETURN
ENDIF
CLEAR DLLS
RETURN
***************************************
but it's not saving the file name. can anyone please help.
thanks in advace!
***************************************
PROCEDURE SetPDFReg
***************************************
LPARAMETERS tcsize
DECLARE Integer RegOpenKeyEx IN Win32API ;
Integer hKey, String lpSubKey, Integer Reserved, ;
Integer samDesired, Integer @phkHandle
DECLARE Integer RegSetValueEx IN Win32API ;
Integer hKey, String lpszValueName, Integer dwReserved,;
Integer fdwType, String lpbData, Integer cbData
DECLARE Integer RegCloseKey IN Win32API ;
Integer nHKey
#DEFINE KEY_SET_VALUE 2
#DEFINE KEY_QUERY_VALUE 1
#DEFINE HKEY_CURRENT_USER -2147483647
#DEFINE REG_SZ 1
lHandle=0
adobe_key='Software\Adobe\Acrobat PDFWriter'+CHR(0)
result=RegOpenKeyEx(HKEY_CURRENT_USER, adobe_key,0,;
KEY_SET_VALUE, @lHandle)
IF result!=0 && it had an error
MESSAGEBOX('Error accessing registry!',16,'Rekon95')
RETURN
ENDIF
invalue="0"+CHR(0)
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'bdocinfo',0,REG_SZ, invalue,invaluesize)
invalue="1"+CHR(0)
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'bembedallfonts',0,REG_SZ, invalue,invaluesize)
invalue="0"+CHR(0)
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'bexecviewer',0,REG_SZ, invalue,invaluesize)
invalue="0"+CHR(0)
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'bsubsettruetype',0,REG_SZ, invalue,invaluesize)
invalue="0"+CHR(0)
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'bsubsettype1',0,REG_SZ, invalue,invaluesize)
invalue=k_drive+':\rekon\prints\'+RIGHT(DTOS(DATE()),6)+"_"+tcSize
IF FILE(invalue+'.PDF')
adder=65
DO WHILE FILE(invalue+"_"+CHR(adder)+".PDF"
adder=adder+1
ENDDO
invalue=invalue+"_"+CHR(adder)+".PDF"
ELSE
invalue=invalue+".PDF"
ENDIF
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'pdffilename',0,REG_SZ, invalue,invaluesize)
invalue=m_oper+CHR(0)
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'szAuthor',0,REG_SZ, invalue,invaluesize)
invalue="Rekon95"+CHR(0)
invaluesize=LEN(invalue)
result=RegSetValueEx(lHandle,'szCreator',0,REG_SZ, invalue,invaluesize)
result=RegCloseKey(lHandle)
IF result!=0 && it had an error
MESSAGEBOX('Error closing registry!',16,'Rekon95')
RETURN
ENDIF
CLEAR DLLS
RETURN
***************************************