Delphi XE5 Isapi on Windows 2003 R2 server - delphi

Situation:
I developed a DelphiXE5 ISAPI Webbroker application on a VMWare workstation under WIndows 7 Pro 64Bit. Testing on that platform with the code compiled as 32bit (default for DelphiXE5) was successful. The program consacts Stamps.com via HTTPS and uses the Stamps.com SOAP web application to purchase postage and create a mailing label with a valid postage stamp (indicium).
The mailing label is created as a PDF on a Stamps server and they send me back a URL which I then use to fetch the PDF and save it in my local SQL Server database. This fetch is done using INDY 10.6.0.5040 (per Remy at Indy). As part of that fetch, the INDY ssl component has to load and use the OpenSSL libraries. These load OK in the test environment.
I then moved the program (compiled as 32bit) to the Windows 64bit 2003 R2 server. This server is a virtual server running under VMWare. I am sure that the actual hardware is truly 64 bit. The OpenSSL libraries will not load on that server. I have tried the most current 32 bit libraries and the most current 64 bit libraries. Same result ... not loading. I tried the ones that load successfully in test .. they failed. Using the Indy WhichFailedToLoad() function shows "failed to load libeay32.dll". Funny thing is , I get the same message with the 64bit libraries. The libraries, even though 32 vs 64 bit, have the same name, so i get the same message. Now, my specific questions are ....
could there be a default area that the libraries load from and my placing them in the same directory as my program dll is not changing anything at all ?? Indy is going the default first and if they exist, that's the ones it is using. If so, does anyone know where that might be. I have tried to trace through the INDY code to see what was hapening but it jumps into assembler and I'm not a ms assembler programmer. I know IBM mainframe assembler in my sleep but MS seems uside down and backwards to me :-)
For Delphi experts out there.... SHould the program really be compiled as a 64 bit application and put in production and then use the 64bit libraries? In the test environment I'm running on 64bit hardware, 64bit host, 64bit guest on which the 32bit compile takes place. The 32 bit libraries work there and it seems that it should work in production on W2003 Server as that is identitical .. except for the OS version.
Could it be permissions problem with IIS 8.5 that wont let my dll read or load the OpenSSL libraries ? If so, any hints as to what ?
I have the DLL in the scripts directory along with libraries.
Who ever figures this out can get a job as my backup :-) ... really !

If your program is 32bit, the dll it uses have to be compiled in 32bit.
As for the location of the OpenSSL dlls, in my case, on a Win2012 R2 server, I put them in C:\Windows\SysWow64\inetsrv.

Related

Unable to interface Com Object built in Delphi XE3

We have an Delphi application that has a built in com object. When compiled in Delphi XE3 (Windows 8) we can't reference it from Visual Studio C#. However, an older version that was compiled in Delphi 2010 (Windows 7) works as expected.
The com object registers without errors and i can access it by using VBA script in Excel. Has anyone come accross something like this?
The most likely explanation is a bitness mismatch. I'm assuming that the COM server is 32 bit since you have been compiling it in Delphi 2010.
Suppose that your COM server is an in-proc server. Then I guess that your failing host is a 64 bit application. If so then you need to make the bitness match. Most probably by switching your host to be 32 bit by targeting x86.
If the COM server is out-of-proc then the issue is with registration rather than executable bitness matching. It will be registered in the 32 bit registry view, but your 64 bit host is looking in the 64 bit view. This would explain why your 32 bit Excel VBA code can find it. You need to register the server in both 32 and 64 bit registry views. Or switch the host to 32 bit.

Cannot load ODBC DLLs in Delphi2007 on Win7 64bit when running inside IDE

Can anyone help with this.
I'm using Delphi2007 December update.
I'm trying to connect to a Gupta database through ODBC and get the error message: The specified module could not be found. C:\Windows\System32\c2gup15.dll.
The DLLs are 32 bit and are found in c:\Windows\SysWow64 as they should be.
When running my compiled program standalone (not inside Delphi) I have no problems.
On XP (my other machine) running within Delphi IDE gives no problems.
All other ways of connecting (like Excel) through this ODBC-driver works perfect.
I'm having this problem both with ODBCExpress and AnyDac.
As I have understood it: When running a 32 bit app in Win7 64 bit windows should automatically use SysWow64 instead of System32.
Does Delphi2007 in some way ruin or override this?
Any suggestions how to solve it? (It's not easy developing software when you can't use your debugger)

How, and where to install a database driver into an IDE? Part II

The background to this query was this question.
I have installed this driver for Firebird and placed it within the path (system32) used by the IDE. The XE Data Explorer recognises the driver, and it is possible to create a connection using the Data Explorer. Trying to view tables or any other database element through this connection results in the error described in this question. As far as I can see #Alejandro Jourdan has not obtained a solution to this problem, and I can find no solution on any of the support sites for Firebird or for Delphi XE.
The second problem comes when I create a TSQLConnection using this connection. The connection works to the extent that it generates the login prompt to the database, but when it tries to open the connection I get the error message: 'file is not a valid database' This error message is (sort of) reproducible from within the Data Explorer which gives the following error:
I/O error during "CreateFile(open)" operation for file [database path] Error while trying to open file. Access is denied..
The database is valid and can be opened from the Firebird command line utility, and from a Data Base browser.
Environment:
Machine: Lenovo Thinkpad W510
OS: Windows 7 Ultimate 64bit
Delphi: Embarcadero® RAD Studio XE Professional Version 15.0.3953.35171
Database: W1-V2.5.0.26074 Firebird 2.5 (64 bit)
Also Installed:
Embarcado Borland® Developer Studio 2006 Enterprise Version 10.0.2288.42451 Update 2 (XP Version)
Borland Delphi Version 7 (XP Version)
EDIT:
See my own answer below. This edit has removed extensive detail that proves to be unnecessary in the light of that answer, while retaining the core of the question, and the links contained within it.
The first thing that sticks out to me is that you're using the 64-bit version of Firebird, and that you mentioned it comes with both a 32- and 64-bit driver. Are the DLLs named the same? If so, I suspect that the IDE/OS are trying to load the 64-bit version of the DLL in a 32-bit application, which isn't possible (32-bit apps can't load 64-bit drivers, and vice versa).
Try one of two things:
First, if the DLLs have the same name, rename the 64-bit version temporarily, and restart the IDE. Then try again.
Try installing the 32-bit version of Firebird, even though you're running a 64-bit OS.
The basic question I had (in part I) was:
I want to install a Firebird database
driver, and to have it available
within the Delphi XE IDE. I want the
database driver to be usable on the
same basis as other, supplied database
drivers (eg Interbase, SQL - from
within the Data Explorer in the IDE).
I have obtained an appropriate driver.
After considerable investigation I have found that it is not possible to achieve the integration into the Delphi IDE that I was trying to achieve. This is because the Data Explorer is a .NET application and the available DBExpress drivers (here and here) are just not compatible with .NET. I understand that I can use the drivers by setting up the parameters appropriately, in both the IDE and by programming in the application I am developing.
I have drafted this answer to assist others to avoid this particular blind alley. I am also editing the part II question in order to remove a lot of the detail, that proves to be unnecessary in the light of this answer.

installing Delphi5 pro in windows 64b

Over the past 15 years or so I've written all the software that runs my medical practice in Delphi 5.
Last week my disk became unbootable/unrecoverable. I have my original D5p disk and all the components backed up but I want to migrate to Windows7. I don't care if my delphi apps look like vista/7; I just want to be able to install it and code on the machine again for maintenance purposes.
are there any tricks to install D5 so it works in W7?
is using a virtual machine really the only/best way? if so, which is suggested?
Thanks in advance.
Larry
LKohnMD#msn.com
I don't know if this helps, but I run Delphi 7 on 64 bit Windows 7 with no problem.
There are some special steps to installing it, but after that, it works fine.
Check out this site for the details: http://www.drbob42.com/examines/examin84.htm
Although I use VMs for other things, running Delphi inside a VM IMO is a nuisance. So it'll be worth your trying the above. On the other hand, I know developers who swear by VMs for this since they can get such great backup snapshots, as noted by others.
I'm not an expert in the Delphi field any more, but I'm pretty sure you're not going to get D5 running on Windows 7 smoothly. Even if you get it running as such, it's going to give you trouble in the details.
But Windows 7's built-in XP virtual machine is a joy to use, and integrates seamlessly (i.e. you can even have Delphi and your old apps in Windows 7's start menu). I'd say the virtual machine is really the way to go. It's called Windows XP mode and can be downloaded here at no extra cost. You just need Windows 7 professional or better, it won't work on a Home edition.
We do commercial software development using Delphi 2009 in a Windows XP Virtual PC, hosted on Windows 7. Until last year, we were using Delphi 7 on an XP virtual machine on Vista. Both are excellent development platforms.
As far as I can see, there are no downsides to this setup. Under Windows 7, the Virtual XP machine integrates right into the desktop using XP mode. Backups are easy, since the VHD file (Virtual Hard Disk) is typically less than 16 GB. There have been absolutely no issues with stability. And although performance within the virtual machine is somewhat slower than on a native machine, the speed difference is not significant.
My opinion is that this is the best solution, and we have been using it successfully for years. If you have any questions about it, just let me know.
I got tired of having to reinstall all my Delphi components whenever I had to setup my machine from scratch/install a new operating system/move to a new laptop, so when I installed Windows Server 2008 (32-bit), I installed Delphi 5 in a virtual machine.
Because of that, when I recently moved to Windows 7, 64-bit, I could use the same virtual machine, no new setup required!
Granted, it is a bit slower, but, hey, this was meant to run on computers a lot slower than they are today.
It's a win/win all the way...
Two people at work are now running Delphi 5 on Windows 7 64-bit.
There is a problem with some Jedi files, that rely on a particular define (WINDOWS i think), that isn't true in 64-bit environment. In the end the Jedi files are not useing Windows.pas. Code then fails to compile when it can't find declarations such as DWORD.
Also, there is a bug in Delphi 5 compiled code, that is only exposed on 64-bit versions of Windows. If you have Overflow Checking turned on, and anything calls SendMessage, the compiled Delphi code is checking that the BOOL value is not greater than $FFFF.
This is wrong, since BOOL is declared by Win32, Microsoft, and Delphi 5, to be a 32-bit boolean value; in x64 it returns $FFFFFFFF as the non-zero value. It works on 32-bit Windows because Microsoft has to maintain compatibility with 16-bit applications; where BOOL was only 16-bits, returning $0000FFFF. 64-bit versions of Windows are unable to run 16-bit applications (this is because a 64-bit CPU running in 64-bit mode does not support running 16-bit instructions)
In other words: turn off Overflow Checks
If you have the option of restoring the original system to a working state, I recommend doing that, and the use the "VMWare vCenter Converter Standalone Client" to make a VM of your current system. Then install VMWare on the new PC when it gets here. Now you can simply bring that up under your new PC, and you've got your trusty old PC ready to roll, any time you need it.
You can do it. More over you can even deploy lower versions too.
I am running Delphi 4 on windows7 32 bit, now I tried to deploy to win 7 b4 bit.
So far the compile, building works, I can run my app outside ide.
Inside ide, I could not register correctly bordbk40.dllm this is why app is not starting from ide.
Database Desktop is also not working, saying unkown compatibility issues.

Delphi compatibility with Windows 2008 Server 64 bit

I have a plan to install my application which is compiled using RAD2010 in Vista 32 bit dev. environment, in a win 2008 server 64 bit.
I use Firebird 2.0 (32 bit) as database server.
Is there any issue? Or it should run without any problem?
No problem for this.
If you can use Firebird 2.1 (a version for 64bit server can be use).
Just take the fbclient.dll (32 bit version)
I see no reason why it shouldn't work, 32 bit processes and services work well under x64. If you need lots of memory for you application you can set the LARGE_ADDRESS_AWARE flag which gives your application access to 4GB of address space instead of 2 GB. If you want that you need to add a line containing {$SetPEFlags $20} to the .dpr file.
We have encountered 2 problems with Windows 2008 Server, but it does not seem they should impact you too much:
Critical Sections now come with a debug baggage that is cached and not freed when they are released. If you create lots of them, the memory footprint of your application will be much bigger. Can happen when using Interfaces or Threads heavily. see is-the-memory-not-reclaimed-for-delphi-apps-running-on-windows-server-2008-sp1 and critical-sections-leaking-memory-on-vista-win2008.
When using ADO, there is a memory leak (in MS stack) when passing the ConnectionString. If you close the connections and open them a lot passing the ConnectionString you end up eating all the memory after a while.
The only problem is if your application is library that needs to be loaded into a 64bit Process.
Examples:
Shell Extensions
ISAPI applications

Resources