Hi:
I have PDF995 installed (and registered) and contacted the PDF995 tech support for help in
setting up to automatically print Access reports using PDF 995. As a result I received the
following materials. I have asked them how I should set this up (being a neophyte or worse
with VBasic) and have not received any advice I can use. Right now even if I set it up as
an operation explicit, I get an error on the { characters.
Can someone please give me the basic setup I should use and I will try and take it from
there. My objective is to have a function i can call that will take parameters and change
the INI file for PDF995 and execute the PDF995 print routine.
I picked another routine up off the PDF995 web site, (which is supposed to create a
function "pdfwrite"), but that doesn't work either since it doesn't create a function that
Access can recognize. I am using Access 2000 and w98!.
Thanks a lot
John Baker
----------------------------------------------------------------------------------------------------------------------
John,
First get the pdf995.ini file using this:
void GetPdf995Path(WCHAR *szRoot, DWORD *szlen)
{
HKEY hkey1;
DWORD type1 = REG_SZ;
long rc;
WCHAR subkeyname[] = TEXT("Software\\Pdf995");
if ((RegOpenKeyEx(HKEY_LOCAL_MACHINE, &subkeyname, 0,
KEY_READ, &hkey1)) == ERROR_SUCCESS)
{
rc = RegQueryValueEx(hkey1, TEXT("Path"), NULL, &type1,
(LPBYTE)szRoot, szlen);
if (rc != ERROR_SUCCESS)
{
wcsncpy(szRoot, TEXT("c:\\"), wcslen(TEXT("c:\\"))+1);
}
RegCloseKey(hkey1);
}
else
{
wcsncpy(szRoot, TEXT("c:\\"), wcslen(TEXT("c:\\"))+1);
}
if (gl_bRunSharedNetwork)
{
WCHAR *ptr;
WCHAR szTemp[1024];
wcscpy(szTemp, gl_szSharedNetworkIni);
ptr = wcsrchr(szTemp, '\\');
ptr[0] = NULL;
ptr = wcsrchr(szTemp, '\\');
ptr[0] = NULL;
ptr = wcsrchr(szTemp, '\\');
ptr[1] = NULL;
wcscpy(szRoot, szTemp);
}
return;
}
/////////////////////////
Then do something like this:
DWORD szlen =1024;
WCHAR szIni[1024];
GetPdf995Path(szLog, &szlen);
GetPdf995Path(szIni, &szlen);
wcscat(szIni, TEXT("pdf995\\res\\pdf995.ini"));
GetPrivateProfileString(TEXT("Parameters"),TEXT("D ebug"), TEXT("0"), szBuf,
sizeof(szBuf), szIni);
if (!atoi(szBuf))
return FALSE;
Thank you,
__________________________________________________ ___________________________________________