Hoping someone out there can help me solve my latest puzzle. If I
"run" a .pdf file on WinNT from ToolBook 7.2 (Acrobat is version 4.05),
I get a fatal error in Acrobat while it is starting up ("AcroRd32.exe
Exception: access violation (0xc0000005), Address: 0x00416ab5 as
reported by Dr. Watson). However, if I double-click on the PDF, or RUN
it from WindowNT's RUN dialog, or even if I "run" it from ToolBook 7.2
on Win98, it works fine (also v3.01 of Acrobat works ok from TB 7.2 on
WinNT). Is this some 16-bit vs. 32-bit problem, like maybe the latest
version of Acrobat is overstepping the amount of RAM it is allocated
from a 16-bit application like ToolBook? Would really appreciate any
clues on this...
Ben.
Hi Ben,
I ran into something similar from Delphi trying to launch a PDF file. I was
using their 16-bit ShellExecute wrapper and getting a GPF. I fixed it by
linking ShellExecuteA() [the 32-bit version] directly. So I would try the
same approach here to see if it helps. If you need a ShellExecuteA example,
let me know and I'll dig one up.
Hope this helps.
Jeff Rhodes
Platte Canyon Multimedia Software Corporation
"Improving the Lives of ToolBook Developers"
http://www.plattecanyon.com
The ToolBook User's Conference
http://www.tbcon.com
I don't think this is a 16/32 bit problem. I have an app authored in
Toolbook 6.1 which runs pdf files using the run command. It works fine on
Win NT Sp5.
Graham
Paul.
-- this routine opens checks for acrobat being installed and opens the PDF
file in it
TO HANDLE OPENPDF string fileName
-- check whether PDF reader installed
local string returnedExecutable;
returnedExecutable = exe("pdf");
-- request returnedExecutable
if not(returnedExecutable <> NULL)then
request "This computer does not have the Acrobat PDF Reader installed.
Would you like to install it now?" with Yes or No
if it is yes then
runstring = quote & (mypath of this book) & "acrobat\ar405eng.exe" &
quote
-- request runstring
run runstring
break handle
end if
else
-- open the pdf
runString = """"& returnedExecutable &"""" && """"&(myPath of this book) &
filename & """"
-- request runstring
run runstring
end
END OPENPDF
-- this routine returns the exe filename associated with a given file type
to get exe string extension
local pMem;
local string tempFile, retVal;
local DWORD dwBufferSize;
linkDLL "tbfile32.dll"
int removeFile32(string);
end
linkDLL32 "shell32.dll"
DWORD FindExecutableA(string, string, pointer32);
end linkDLL32
linkDLL32 "kernel32.dll"
DWORD GetTempPathA(DWORD, pointer32);
pointer32 GlobalAlloc(DWORD, DWORD);
DWORD GlobalFree(pointer32);
end linkdll32
dwBufferSize = 260; -- MAX_PATH
pMem = GlobalAlloc(0, dwBufferSize);
if (GetTempPathA(dwBufferSize, pMem) <> 0) then
tempFile = pointerString32(0, pMem);
if (last char of tempFile <> "\") then
put "\" after tempFile;
end if
else
tempFile = "c:\";
end if
put "$_dummy" after tempFile;
if (first char of extension <> ".") then
put "." after tempFile;
end if
put extension after tempFile;
-- create a dummy file
createFile tempFile;
closeFile tempFile;
if (FindExecutableA(tempFile, "c:\", pMem) > 32) then
retVal = pointerString32(0, pMem);
end if
get GlobalFree(pMem);
get removeFile32(tempFile);
return retVal;
end
--
Dean Interactive Learning Ltd
http://www.deancbt.co.uk
9 The South West Centre
Troutbeck Rd
Sheffield S7 2QA
United Kingdom
Tel: +44 (0)114 258 1171
Fax: +44 (0)114 258 1338
Ben Williams <bewil...@link.com> wrote in message
news:3AD382C3...@link.com...
Ben.
"Puzzles, puzzles, everywhere. And no where to hide..."