Results 1 to 3 of 3

Thread: Convert to Delphi

  1. #1

    Question Convert to Delphi

    Can someone please help me convert this C++ code to delphi:

    a_Buffer = (BYTE*)malloc(aWidth*aHeight);
    memset(a_Buffer, 0x55, aWidth*aHeight)

    The first line I do with:
    CreatePMemory(a_Buffer, Integer(aWidth*aHeight));

    The second one?

    I would greatly appreciate any help.

  2. #2
    Senior Member Thaddy's Avatar
    Join Date
    Dec 2004
    Location
    Amsterdam
    Posts
    2,211
    Code:
    var
    a_buffer:Pointer;  // get a decent more exact pointer typr: a typed pointer. I am playing lazy.
    getmem(a_buffer, aWidth*aHeight);
    fillchar(a_buffer,aWidth*aHeight,$55);
    end.
    Last edited by Thaddy; 20-Aug-16 at 15:46. Reason: code
    Werken aan Ansi support voor Windows is verspilde tijd, behalve voor historici.

  3. #3
    Thank you so much for your quick response.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •