Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Record copied to memory stream

Posted on 1998-12-05
3
Medium Priority
?
754 Views
Last Modified: 2008-03-06
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
Comment
Question by:yvesmail
  • 2
3 Comments
 
LVL 10

Expert Comment

by:viktornet
ID: 1349439
YOu can type cast the pointer...something like that would do it ....

NewTMyRecord := TMyRecord(lpbData^);

Something like that...

Cheers,
Viktor
0
 

Author Comment

by:yvesmail
ID: 1349440
Thank you Viktor. It works. You may have the points.
0
 
LVL 10

Accepted Solution

by:
viktornet earned 400 total points
ID: 1349441
Thanks yvesmail :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question