🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.pascal.delphi.misc
1 messages
1 total messages Started by Joachim Marder marder a jam - so... Tue, 22 Jun 2004 14:03
IMalloc.Alloc() not working in Delphi 8
#292
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads