Delphi

How to byte array received from socket, to C# structure

两盒软妹~` 提交于 2020-01-23 01:10:29
问题 I have to Develop a Service (C#) which read data from Network Device via TCP Socket and convert this is C# structure. I am basing on existing, old Delphi application which is doing all this stuff and I have to migrate logic in C#. EDITED: I got a snapshot from C-Source of original data-structure: struct _RequestMsgStruct { UCHAR request_ver; //In DELPHI it is represented as Byte USHORT mac_addr[3]; /* MAC Address */ UINT product_type; //In DELPHI - Cardinal UCHAR supply_type; //In DELPHI -

Delphi 2007 : How to Set TSAWARE?

妖精的绣舞 提交于 2020-01-22 19:52:08
问题 In Delphi 2009 and up you can add this line to your project .dpr to set the TSAWARE PE flag in your application executable: {$SetPEOptFlags IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE} I thought (wrongly) that this syntax is not supported in Delphi 2007. I have an application that I cannot port from 2007 to a newer Delphi version just yet (the task is underway, but it will not be done in the next few months). Update it was simply that Windows must be added to the project .dpr also. 回答1: My

Delphi 2007 : How to Set TSAWARE?

痞子三分冷 提交于 2020-01-22 19:52:07
问题 In Delphi 2009 and up you can add this line to your project .dpr to set the TSAWARE PE flag in your application executable: {$SetPEOptFlags IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE} I thought (wrongly) that this syntax is not supported in Delphi 2007. I have an application that I cannot port from 2007 to a newer Delphi version just yet (the task is underway, but it will not be done in the next few months). Update it was simply that Windows must be added to the project .dpr also. 回答1: My

Datasnap : Is there a way to detect connection loss globally?

我与影子孤独终老i 提交于 2020-01-22 19:49:22
问题 I'm looking to detect local connection loss. Is there a mean to do that, as with the events on the Corelabs components ? Thanks EDIT: Sorry, I'm going to try to be more specific: I'm currently designing a prototype using datasnap 2009. So I've got a thin client, a stateless server app and a database server. What I would be able to do is to detect and handle connection loss (internet connectivity) between the client and the server app to handle it appropriately, ie: Display an informative

Delphi 7 tguid compare

拈花ヽ惹草 提交于 2020-01-22 18:49:04
问题 Is any other way to compare 2 TGUID elements, except transform them into strings (the guidtostring function) and after evaluate the expression, in Delphi 7? 回答1: You can use IsEqualGUID API declared in SysUtils. 回答2: IsEqualGUID() (or IsEqualIID()), like TOndrej suggested. You can also use SysUtuils. CompareMem() instead, since TGuid is a binary array of bytes. 来源: https://stackoverflow.com/questions/4012581/delphi-7-tguid-compare

What data type is suitable to handle binary data in ActiveX method?

妖精的绣舞 提交于 2020-01-22 15:17:25
问题 I'm writing an ActiveX control for my friend, that should encapsulate encryption routines. It will be used from VB6 primarily. What data type should I choose for binary data like encryption key, initialization vector, input and output data so that it would be convenient for my friend to use it from VB6? I'm using Delphi 7 to write this ActiveX, if that matters. One choice is to use hexadecimal strings. What can be the other? 回答1: VB6 Binary data stored in Byte variables and arrays. Dim

Delphi DataSnap framework adding stuff to JSON message

一笑奈何 提交于 2020-01-22 14:52:07
问题 I'm working with a Delphi XE DataSnap REST server and trying to return a JSON serialized object. The result that my method is returning to the client looks like this: {"type":"ServerMethodsUnit1.TJSONIssue", "id":1, "fields":{ "FIssueNo":90210, "FTitle":"Beverly Hills...that''s where I want to be", "FKind":"Wishlist" } } Well formed JSON. The problem is that when the message is received by the client, there's a bunch of stuff added to it and it looks like this: {"result": ["{\"type\":\

Delphi DataSnap framework adding stuff to JSON message

冷暖自知 提交于 2020-01-22 14:52:07
问题 I'm working with a Delphi XE DataSnap REST server and trying to return a JSON serialized object. The result that my method is returning to the client looks like this: {"type":"ServerMethodsUnit1.TJSONIssue", "id":1, "fields":{ "FIssueNo":90210, "FTitle":"Beverly Hills...that''s where I want to be", "FKind":"Wishlist" } } Well formed JSON. The problem is that when the message is received by the client, there's a bunch of stuff added to it and it looks like this: {"result": ["{\"type\":\

Is it possible to determine if the text in a dbEdit is longer than what is visible?

↘锁芯ラ 提交于 2020-01-22 14:38:30
问题 On some forms I have dbEdits that sometimes aren't wide enough to show all the text their fields may contain. For them I have the following code: procedure Tgm12edLots.dbeLotNameMouseEnter(Sender: TObject); begin with dbeLotName do begin ShowHint := True; Hint := Text; end; end; I'd like to avoid the hint showing if all the text is visible, but I don't how to test for that condition. Thanks for any tips/suggestions! 回答1: I think this should work... function CanShowAllText(Edit: TDBEdit)

Is it possible to determine if the text in a dbEdit is longer than what is visible?

对着背影说爱祢 提交于 2020-01-22 14:37:18
问题 On some forms I have dbEdits that sometimes aren't wide enough to show all the text their fields may contain. For them I have the following code: procedure Tgm12edLots.dbeLotNameMouseEnter(Sender: TObject); begin with dbeLotName do begin ShowHint := True; Hint := Text; end; end; I'd like to avoid the hint showing if all the text is visible, but I don't how to test for that condition. Thanks for any tips/suggestions! 回答1: I think this should work... function CanShowAllText(Edit: TDBEdit)