Board index » delphi » Pointer to object

Pointer to object

Well, well, since I don't have any answer (no worry... hmm...), I'll ask
my question differently.
I have a pointer to a series of TSomething (TBitmapFileHeader, then
TBitmapInfo), and I would like to access the TBitmapInfo structure.
I tried to make a PBitmapInfo structure and make this instruction :
PBitmapInfo := Pointer + SizeOf(TBitmapFileHeader);

but it doesn't work...

other question : how can I copy memory blocks ? I mean, I'd like
to copy a block from the memory to a TSomething structure, but
I can't find any solution... arghhhh.... (MemoryWrite seems too
complex for me...)

thanks !

--
Ren-Gilles Deberdt (Naoki)
http://www.namida.com/

 

Re:Pointer to object


Quote
Naoki Haga wrote:

> Well, well, since I don't have any answer (no worry... hmm...), I'll ask
> my question differently.
> I have a pointer to a series of TSomething (TBitmapFileHeader, then
> TBitmapInfo), and I would like to access the TBitmapInfo structure.
> I tried to make a PBitmapInfo structure and make this instruction :
> PBitmapInfo := Pointer + SizeOf(TBitmapFileHeader);

> but it doesn't work...

> other question : how can I copy memory blocks ? I mean, I'd like
> to copy a block from the memory to a TSomething structure, but
> I can't find any solution... arghhhh.... (MemoryWrite seems too
> complex for me...)

On the subject of copying memory blocks, have you looked at the BP
command copy?  It does just that.

As for the first part, I don't quite get what you're saying.  Perhaps
you could explain a little better?

Cheers,

JB

Re:Pointer to object


In article <3334CD09.2...@mad.scientist.com>

Quote
John Breen <wom...@mad.scientist.com> wrote:
>> Well, well, since I don't have any answer (no worry... hmm...), I'll ask
>> my question differently.
>> I have a pointer to a series of TSomething (TBitmapFileHeader, then
>> TBitmapInfo), and I would like to access the TBitmapInfo structure.
>> I tried to make a PBitmapInfo structure and make this instruction :
>> PBitmapInfo := Pointer + SizeOf(TBitmapFileHeader);

>> but it doesn't work...

>> other question : how can I copy memory blocks ? I mean, I'd like
>> to copy a block from the memory to a TSomething structure, but
>> I can't find any solution... arghhhh.... (MemoryWrite seems too
>> complex for me...)

> On the subject of copying memory blocks, have you looked at the BP
> command copy?  It does just that.

are you sure ? my "Copy" command works only for strings, not for
memory blocks....

Quote
> As for the first part, I don't quite get what you're saying.  Perhaps
> you could explain a little better?

I have a pointer to a memory block where you can find a TBitmapFileHeader
structure followed by a TBitmapInfo structure (next in the memory block, OK ?)
and I would like to create a pointer on the TBitmapInfo structure (of the type
PBitmapInfo, of course.)

Thanks.

--
Ren-Gilles Deberdt (Naoki)
http://www.namida.com/

Other Threads