Re: Pointers in delphi
- From: Jamie <jamie_5_not_valid_after_5_Please@xxxxxxxxxxx>
- Date: Fri, 01 Apr 2005 09:23:57 -0800
qnewpq wrote:
WideString is already a pointer that looks at the data.am doing an application in biometric. I am allocating a pointer and the size needed to store the image data. then i need to copy data from another variable to this pointer.
{ ImgDetail is widestring. myImage is untyped pointer. } 1. ImgDetail:='}↓§ruiyweurywuyrfwiuhasicasid etc'; 2. Reallomem(myImage,2356); 3. myImage:=@ImgDetail;
when i do the above my sensor driver is giving me an error. I have tested
all the options and found out its line 3 which is not ok! how can I copy
the image details to the space allocated in the pointer? so that I dont
point myimage to ImaDetail teh way am doing? The image details is in
ascii.
Please help!
you can pass the ImgDetail directly where as a pointer using a
case.
from looking at your code, i think all you want to do is perform a
copy.
CopyMemory(MyImage, Pointer(ImgDetail), 2356); or , the size could be the Length(ImgDetail)*2 etc...
if your trying only to set a generic pointer from a non generic type then you could try this MyImage := Pointer(imgDetail); but care must be taken here, when changing the contents of imgDetail in the standard way of strings, the string pointer most likely will change.
.
- Prev by Date: Re: Pointers in delphi
- Next by Date: barcode labels & rave Help
- Previous by thread: Re: Pointers in delphi
- Next by thread: barcode labels & rave Help
- Index(es):
Relevant Pages
|