IIS ISAPI error DelphiXE7 - delphi

Server 2008
IIS 6.0
Delphi XE7
I am getting an error when I read from a stream into a TWICImage on my dll.
Error
Access violation at address 75DB59B5 in module 'ole32.dll'. Read of address 0000000D
WIC:=TWICImage.Create;
Innstream:= TmemoryStream.Create();
Try
// Line below gets a stream from Amazon
ok := ass.GetObject(bucket,folder+'/'+filnavn,Innstream, nil);
Innstream.Position:= 0;
wic.LoadFromStream(Innstream); // This line create the error
from_image.Assign(Wic);
wic.LoadFromStream(Innstream); // This line create the error
If I setup same code in a VCL exe application it works ok , so I guess its my dll missing access to something
any idea ?

Related

How to download file using TIdHTTP Indy component?

I get this error when I try to download a file using TIdHTTP component:
First chance exception at $76D8AAF2. Exception class EIdOSSLUnderlyingCryptoError with message
'Error connecting with SSL.
error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'.
Process Project1.exe (3684)
I have Indy version 10.6.2.5341 shipped with Embarcadero Rad Studio 10.1 Berlin.
I'm using IdSSLIOHandlerSocketOpenSSL with those options enabled:
[sslvtlsv1, sslvtlsv1_1, sslvtlsv1_2], but still same error, I also have ssl dlls in my application exe directory (libeay32.dll and ssleay32.dll) version 1.0.2u, got it from this post:
How can we connect with a website? Getting SSL error 1409442E
And this code I use to download a file:
const UnicodeString URL = "https://www.rarlab.com/rar/winrar-x64-60b1.exe";
TMemoryStream *ms = new TMemoryStream();
try
{
IdHTTP1->Get(URL, ms);
ms->SaveToFile("E://winrar.exe");
}
__finally
{
delete ms;
}
Update: I upgraded to Indy version 10.6.2.0 and still have the same SSL problem.

Getting Delphi to read a database with a new version of Microsoft Access

We use a Delphi 10 programme that reads in an Access database. I do not deeply understand how it does it, except that I believe it uses units called DAO.pas and DAO_TLB.pas.
I recently upgraded from Office 2007 to Office 2016, and since then the Delphi programme is unable to read from the database; it gives the error:
Project MyProj.exe raised exception class EOleSysError with message 'Class not registered'.
I have tried to search to find how to fix this but am struggling because I don't really understand what's going on under the hood. I tried to install the Access 2016 type library, but that didn't seem to make any difference.
Extremely grateful for any help.
Thanks,
Tom
EDIT: DAO.pas is here. DAO_TLB.pas is where the error is triggered; the function which errors is:
class function CoDBEngine.Create: _DBEngine;
begin
Result := CreateComObject(CLASS_DBEngine) as _DBEngine;
end;
Where CLASS_DBEngine is a constant declared as:
CLASS_DBEngine: TGUID = '{CD7791B9-43FD-42C5-AE42-8DD2811F0419}';
I have also just noticed that, when the error occurs, if I click continue rather than break, a new error appears, saying:
Class not registered, ClassID: {CD7791B9-43FD-42C5-AE42-8DD2811F0419}
i.e. the ClassID is the CLASS_DBEngine constant.

LuaInterface error loading module(Lua for Windows is OK)

While I DoFile:
Lua luaVM = new Lua();
luaVM.DoFile("test.lua");
This is the error I got.
An unhandled exception of type 'LuaInterface.LuaException' occurred in LuaInterface.dll
Additional information: error loading module 'mytestlib' from file '.\mytestlib.dll':
%1 is not a valid Win32 application.
The dll is I made, It works when I call this lua from LFW(lua for Windows).
Do I need something like a environment variables? (I added the lua/5.1 folder to EV)

How to debug inno-setup exceptions

I compiled inno-setup with XE6 myself. (I know, the document suggested older delphi versions, but I only have new IDE)
I want to use pascal script to customize setup. But even I added a simplest [Code] section, the created installation crash.
[Code]
function InitializeSetup(): Boolean;
begin
end;
The created setup.exe failed while being installed:
[22:10:29.945] *** Setup started
[22:10:36.182] Setup version: Inno Setup version 5.5.4 (u)
[22:10:36.186] Original Setup EXE: D:\Classics\Save\Installer\Win_Platform\Inno Setup\test\Output\setup.exe
[22:10:36.190] Setup command line: /SL5="$911152,176640,176640,D:\Classics\Save\Installer\Win_Platform\Inno Setup\test\Output\setup.exe" /SPAWNWND=$7B05B8 /NOTIFYWND=$1150B10 /DEBUGWND=$74002E
[22:10:36.200] Windows version: 6.2.9200 (NT platform: Yes)
[22:10:36.203] 64-bit Windows: Yes
[22:10:36.209] Processor architecture: x64
[22:10:36.212] User privileges: Administrative
[22:10:37.660] 64-bit install mode: No
[22:10:37.674] Created temporary directory: C:\Users\CAOSHU~1\AppData\Local\Temp\is-5AOTJ.tmp
[22:10:37.717] InitializeSetup raised an exception (fatal).
[22:10:37.725] Exception message:
[22:10:37.734] Message box (OK):
Access violation at address 006043C0 in module 'setup.tmp'. Read of address 00000014.
[22:11:03.501] User chose OK.
[22:11:03.515] Deinitializing Setup.
[22:11:04.424] *** Setup exit code: 1
Perhaps the way I compiled inno setup has some problems. I need not use XE6? But how to debug and figure out where the problem is?
It is not some code which crashes when it runs. It is a setup.exe which created by inno setup.
The value returned by InitializeSetup() is undefined.
function InitializeSetup(): Boolean;
begin
result := true;
end;
You get an undefined behaviour because of this. If most of the time the result will be false (last 8 bits of RAX == 0), this is not always the case and you'll get a seriously "hard to understand" issue, particularly when, for no reason, it'll work.

embedded firebird 2.5 >> DBX Error: Driver could not be properly initialised

i'm try to connect to firebird 2.5 Embedded version(win32) with Delphi XE , I get the error when a click Test Connection
any help?
LibraryName and VendorLib should be in search path
copy LibraryName "i'm using dbx4fb.dll from https://sites.google.com/site/dbxfirebird/home" and
VendorLib "fbclient.dll founded in firebird directory\bin" to the search path "for delphi xe : Program Files\Embarcadero\RAD Studio\8.0\bin"

Resources