Board index » delphi » Memo >64k BIG problem

Memo >64k BIG problem

We have a Borland C DLL that reserves 1 Mb block memory, and a user
interface made in Delphi 1. The problem is we can't access it from
Delphi. We obtain a General protection error because it is only able to
access the first segment of 64Kb.

Is it a problem from Delphi 1?

If it is a problem from Delphi 1, can it be solved using Delphi 2?

Thanks.

 

Re:Memo >64k BIG problem


Quote
Oscar Lopez Cisneros wrote:

> We have a Borland C DLL that reserves 1 Mb block memory, and a user
> interface made in Delphi 1. The problem is we can't access it from
> Delphi. We obtain a General protection error because it is only able to
> access the first segment of 64Kb.

> Is it a problem from Delphi 1?

> If it is a problem from Delphi 1, can it be solved using Delphi 2?

> Thanks.

Delphi 1 wraps a window control that only handles 32k ish amount of
memory.  Could that be the issue?  Delphi 1 does do DPMI...

Re:Memo >64k BIG problem


On Wed, 4 Dec 1996 16:31:50 +0000, Oscar Lopez Cisneros

Quote
<os...@gpi.tsc.uvigo.es> wrote:

>We have a Borland C DLL that reserves 1 Mb block memory, and a user
>interface made in Delphi 1. The problem is we can't access it from
>Delphi. We obtain a General protection error because it is only able to
>access the first segment of 64Kb.

>Is it a problem from Delphi 1?

No. Just slightly more complicated (see below)

Quote
>If it is a problem from Delphi 1, can it be solved using Delphi 2?

It's just a bit easier.

With Delphi 1 you basically are restricted to the 64KB _pointerwise_.
What you can easily do, to pass a "huge" pointer (i.e. a pointer
pointing to a datastructure > 64 KB) to Delphi 1 is passing a THandle
to a GlobalAlloc'ed memory block; you then can GlobalLock this memory,
retrieving a pointer; with this pointer you can use OffsetPointer (see
in Classes.Pas -> TMemoryStream, it is NOT public) to access ANY
element in this memory block...

In Delphi 2 you just use the pointer.
--
Stefan Hoffmeister                   Stefan.Hoffmeis...@Uni-Passau.de
University of Passau, Bavaria, Germany

Other Threads