Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 7 of 7 total |
How to convert a TEDBMemoryStream to a delphi TMemoryStream |
Tue, Apr 26 2022 11:57 AM | Permanent Link |
George | Hi, I am quite new to this and I would appreciate it if you could help me on transforming a TEDBMemoryStream to a delphi TMemoryStream.
I need this in an external module server module for EDB server where I transfer a blob field as a parameter (which is of type TEDBMemoryStream) for further processing. Thanks George |
Wed, Apr 27 2022 2:43 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | George
I believe they are both descended from TStream so a simple cast may work (not tried it) but you're better off doing a copy eg Destination.Clear; // Clear existing data first if we're replacing it Destination.CopyFrom(Source, Source.Size); Roy Lambert |
Wed, Apr 27 2022 9:06 AM | Permanent Link |
George | Roy,
>I believe they are both descended from TStream so a simple cast may work (not tried it) but you're better off doing >a copy eg > Destination.Clear; // Clear existing data first if we're replacing it > Destination.CopyFrom(Source, Source.Size); I have tried that, however I get an error message: E2010 Incompatible types: 'TStream' and 'TEDBMememoryStream' I have used the Lightweight External Module template as a basis for the module (if that helps) Thanks George |
Thu, Apr 28 2022 12:57 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | George
I went to set up a test project but I can't find TEDBMemoryStream - which unit is it in? Roy Lambert |
Thu, Apr 28 2022 3:43 AM | Permanent Link |
George | Roy,
>I went to set up a test project but I can't find TEDBMemoryStream - which unit is it in? Below is part of the code, the AsBlob is of type TEDBMemoryStream: procedure TEDBLightweightExternalModule1.DoRoutine(const RoutineName: String); var Attachment : TMemoryStream; begin Attachment := TMemoryStream.Create ; Attachment.CopyFrom(ParamValues.FindByName('Attachment').AsBlob); Result := MailSender.SendEmail(......, Attachment); end; |
Thu, Apr 28 2022 4:17 AM | Permanent Link |
Roy Lambert NLH Associates Team Elevate | George
Try Attachment.CopyFrom(TMemoryStream(ParamValues.FindByName('Attachment').AsBlob),SizeOf(TMemoryStream(ParamValues.FindByName('Attachment').AsBlob))); and see what happens Depending on what MailSender.SendEmail is looking for you can also try MailSender.SendEmail(TMemoryStream(ParamValues.FindByName('Attachment').AsBlob)) Roy Lambert |
Fri, Apr 29 2022 1:31 AM | Permanent Link |
George | Roy,
Perfect, many thanks! George |
This web page was last updated on Monday, April 29, 2024 at 05:23 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |