I'm currently adapating one of our programs so that rather than printing to hardcopy, some reports will be saved as PDF documents.
I have succesfully used RegSetValueEx in ADVAPI32.DLL to write out the string value (type REG_SZ in the registry) of the document name prior to PDF'ing, but I also need to set and unset another flag in the registry used by the PDF driver.
However, when I try to write out the flag setting (1 or 0),the registry ends up with silly numbers like 5f000031! I'm missing something critical with respect to writing out a REG_DWORD type but hours of Googling and searching on here later I'm still none the wiser.
Sample code for reference:
If I try to re-declare the RegSetValueEx call to define the data as an Integer, the call returns a success code, but no data changes in the registry.
Any help, gratefully appreciated!!
Ric
I have succesfully used RegSetValueEx in ADVAPI32.DLL to write out the string value (type REG_SZ in the registry) of the document name prior to PDF'ing, but I also need to set and unset another flag in the registry used by the PDF driver.
However, when I try to write out the flag setting (1 or 0),the registry ends up with silly numbers like 5f000031! I'm missing something critical with respect to writing out a REG_DWORD type but hours of Googling and searching on here later I'm still none the wiser.
Sample code for reference:
Code:
PUBLIC RESULT,DISPLAY
RESULT=0
DISPLAY=0
#DEFINE HKEY_CURRENT_USER 2147483649 && (HKEY) 0x80000001
#DEFINE SECURITY_ACCESS_MASK 983103 && SAM value KEY_ALL_ACCESS
#DEFINE REG_SZ 1
#DEFINE REG_DWORD 4
DECLARE RegCreateKeyEx IN ADVAPI32.DLL;
INTEGER,STRING,INTEGER,STRING,INTEGER,INTEGER,INTEGER,INTEGER @, INTEGER @
DECLARE RegSetValueEx IN ADVAPI32.DLL;
INTEGER,STRING,INTEGER,INTEGER,STRING,INTEGER
RegCreateKeyEx(HKEY_CURRENT_USER,"SOFTWARE\VERYPDF\PDFCAMP",0,"REG_SZ",;
0,SECURITY_ACCESS_MASK,0,@RESULT,@DISPLAY) && Returns .T. if successful
OutputFile="c:\test4.pdf"
FileLen=LEN(OutputFile)+1
RegSetValueEx(RESULT,"AutomaticDirectory",0,REG_SZ,OutputFile,FileLen)
lnBit= "1" && tried adding CHR(0) also but no help.
RegSetValueEx(RESULT,"AutomaticOutput",0,REG_DWORD,lnBit,4)
If I try to re-declare the RegSetValueEx call to define the data as an Integer, the call returns a success code, but no data changes in the registry.
Any help, gratefully appreciated!!
Ric