🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.misc
Article #292

IMalloc.Alloc() not working in Delphi 8

#292
From: Joachim Marder marder a jam - so...
Date: Tue, 22 Jun 2004 14:03
21 lines
1619 bytes
Hi.

I just tried to use the Alloc() method of the IMalloc COM interface,
but it always returns 0. The following line should allow to reproduce
the problem:

var Malloc: IMalloc;
    Pointer: IntPtr;
begin
  if SHGetMalloc(Malloc)<>NOERROR then exit;
  Pointer := Malloc.Alloc(100);

SHGetMAlloc() succeeds, but Alloc(100) always returns a NULL pointer.
I have tried adding {$UNSAFECODE ON} and CoInitialize() but with no
change. I wonder if anyone else succeeded in allocating memory using
the IMalloc interface or any other way. I need the memory to store an
ItemIDList.

Thanks in advance and best regards,

Joachim
Technical Details
Message-ID: <1cdead5d.0406220603.148db700@posting.google.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews2.google.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10baee,10a49af5da5c26a5,start
X-Google-Thread: 1091e5,fbff9ad029a8277e,start
X-Google-Thread: f94dd,5b7abb1fd5699d86,start
X-Google-Attributes: gid10baee,gid1091e5,gidf94dd,public
Path: arc1-ca.pugleaf.net!g2news1.google.com!postnews2.google.com!not-for-mail
From: info@jamsoft.net (Joachim Marder  marder  a  jam - software.com.remove)
Newsgroups: comp.lang.pascal.delphi.misc,borland.public.delphi.winapi,borland.public.delphi.nativeapi
Subject: IMalloc.Alloc() not working in Delphi 8
Date: 22 Jun 2004 07:03:21 -0700
Organization: http://groups.google.com
Lines: 21
Message-ID: <1cdead5d.0406220603.148db700@posting.google.com>
NNTP-Posting-Host: 217.84.161.67
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1087913006 27342 127.0.0.1 (22 Jun 2004 14:03:26 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 22 Jun 2004 14:03:26 +0000 (UTC)