• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 758
  • Last Modified:

Record copied to memory stream

My program first stores values in a record type which contains integers and strings. Because this record is passed to an ISAPI program, the record is loaded into a memorystream using TMemoryStream.WriteBuffer. This happens on the client size.

On the server side (the ISAPI DLL), the bytes are then stored in a Pointer type :

 lpbData: Pointer;                 // pointer to cbAvailable bytes

I then want to copy what is in lpbData back into a record identical to the one at the client site.

What is the best way to do that to ensure the record at the server is intact ?

0
yvesmail
Asked:
yvesmail
  • 2
1 Solution
 
viktornetCommented:
YOu can type cast the pointer...something like that would do it ....

NewTMyRecord := TMyRecord(lpbData^);

Something like that...

Cheers,
Viktor
0
 
yvesmailAuthor Commented:
Thank you Viktor. It works. You may have the points.
0
 
viktornetCommented:
Thanks yvesmail :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now