Archive for November, 2008

TPrintDialog and Copies in Delphi 5

Friday, November 21st, 2008

After 10 years of using Delphi I just discovered that using TPrintDialog to set the printer and then using TQuickRep.PrinterSettings.PrinterIndex := Printer.PrinterIndex doesn’t set the number of copies specified by the user to TPrintDialog.  This has to be done manually like this: TQuickRep.PrinterSettings.Copies := TPrinterDialog.Copies.

I guess you really do learn something new everyday.

ISAPI Applications that Refuse to Run

Friday, November 14th, 2008

One of my customers developed an interesting problem the other day.  None of their ISAPI applications would run.  Any attempt to use an ISAPI DLL would hang and eventually time out.  IIS was not logging any errors to the IIS log files or the system event log.  It was a genuine mystery.

By inserting code that wrote progress messages to a trace file I was able to determine that the DLL was being initialized but the HTTP request was not being processed.  I could see code in the project’s main (.DPR) file being executed, then the TISAPIApplication.GetExtensionVersion method was being executed but that was it, TISAPIApplication.HTTPExtensionProc was never executed.

It took me a very long time to realize that IIS was failing when trying to switch to the internet guest account before executing HTTPExtensionProc.  I never did figure out what happened to the internet guest account, but by changing the ISAPI DLLs to execute using a ‘real’ user id rather than the internet guest account I got everything working again.  Go figure.