delphi-2010

Json parse result from virustotal api

半城伤御伤魂 提交于 2019-12-05 08:53:15
I was playing around with the virustotal api today while becoming back the result in this form : { "permalink" : "http://www.virustotal.com/file-scan/report.html?id=7b6b268cbca9d421aabba5f08533d3dcaba50e0f7887b07ef2bd66bf218b35ff-1304089592", "report" : [ "2011-04-29 15:06:32", { "AVG" : "Exploit_c.TVH", "AhnLab-V3" : "PDF/Exploit", "AntiVir" : "EXP/Pidief.UK", "Antiy-AVL" : "Trojan/win32.agent", "Avast" : "JS:Pdfka-gen", "Avast5" : "JS:Pdfka-gen", "BitDefender" : "Exploit.PDF-JS.Gen", "CAT-QuickHeal" : "", "ClamAV" : "", "Comodo" : "Exploit.JS.Pidief.~AWQ", "DrWeb" : "", "Emsisoft" : "Exploit

What are the Rave BE “reports in code” alternatives in a Delphi 2010 migration project?

烈酒焚心 提交于 2019-12-05 07:23:01
问题 I want to migrate a Delphi 7 project to Delphi 2010. We are building "reports in code" with TReportShell and TDetailShell components from Rave BE. Those components does not exist any more in Rave BE 7.7. Moreover it seems that unicode support is broken in Rave BE ( Displaying unicode text in Rave Reports on Delphi 2009 ). What sould be the best solution to port this project to Delphi 2010 ? Reimplement the code written aruond TReportShell and TDetailShell to use the new TRvNDRWriter component

How to start building a searchable garbage collector in Delphi (2009-2010)

a 夏天 提交于 2019-12-05 07:05:56
I'm looking for a way to control all business objects I create in my applications written in Delphi. As an article on Embarcadero's EDN ( http://edn.embarcadero.com/article/28217 ) states, there are basically three ways to do this. I'm mostly interested in the last one, using interfaces. That way, when the business object is no longer being referenced anywhere in the application, it will be dispose of memory wise (I'll get back on this part later). When creating a new business object, it would be wise to ask that new object manager whether I already fetched it earlier in the program, thus

Handle file drop in TShellListView descendant

蹲街弑〆低调 提交于 2019-12-05 06:23:39
I am attempting to create a descendant of TShellListView that accepts files dropped from Windows Explorer. I want to handle the drag/drop in my component definition without having to implement it in any of the applications that use the component (I've found examples of accepting files dropped from Windows Explorer, but all at the application / TForm level). I'm calling DragAcceptFiles() in my constructor, and I've defined a message handler for WM_DROPFILES. However, when I use this component in a sample project and drag a file from Windows Explorer: I see the "not accepted" icon (circle w/

How to split the string in delphi

China☆狼群 提交于 2019-12-05 04:15:10
I just need to split a string like: "STANS", "Payment, chk#1", ,1210.000 into an array based on , . The result in the string list would be STANS Payment, chk#1 1210.000 Create a TStringList and assign your comma separated string to StringList.CommaText . This parses your input and returns the split strings as the items of the string list. StringList.CommaText := '"STANS", "Payment, chk# 1", ,1210.000'; //StringList[0]='STANS' //StringList[1]='Payment, chk# 1' //etc. I wrote this function and works perfect for me in Delphi 2007 function ParseCSV(const S: string; ADelimiter: Char = ',';

Howto set event handlers with arbitrary type with RTTI in Delphi 2010?

℡╲_俬逩灬. 提交于 2019-12-05 04:02:21
问题 after reading the post How to set event handlers via new RTTI?, I wonder if it is possible to solve this more dynamically. For example I want to set ALL event handlers of any component to nil. Using TValue.From <TNotifyEvent> (SomeMethod) does not work for two reasons: 1. The type is unknown (could be TNotifyEvent, TMouseEvent etc.) 2. I cannot set 'SomeMethod' to nil (invalid cast) In old RTTI style I would do something like: var NilMethod: TMethod; begin [...] NilMethod.Data := nil;

Delphi: A generic list of generic-descendants and taking a generic as a parameter

可紊 提交于 2019-12-05 03:14:07
问题 I struggle a little with the understanding of generics and how they can and can not be used. I have a generic class TControlMediator like this: TControlMediator<C, T> = class private FMediatedComponent: C; public constructor Create(ComponentToMediate: C); function GetValue: T; virtual; abstract; procedure SetValue(Value: T); virtual; abstract; property MediatedControl: C read FMediatedComponent; end; I then make 'concret' subclasses for each control type that I want to mediate: TEditMediator

Why does OnMouseMove fire repeatedly when the mouse is not moving in D2010?

 ̄綄美尐妖づ 提交于 2019-12-05 03:03:39
I'm porting a Delphi 5 app to D2010, and I've got a bit of a problem. On one form is a TImage component with an OnMouseMove event that's supposed to update a label whenever the mouse is moved over the image. This worked just fine in the original app, but now the OnMouseMove event fires constantly whenever the mouse is over the image, whether it's moving or not, which causes the label to flicker horribly. Does anyone know what's causing this and how to fix it? My psychic debugging sense tells me that you are on Windows, the label is a tooltip window and you are updating on every mousemove. In

How can I declare an array property?

有些话、适合烂在心里 提交于 2019-12-05 02:41:01
I constructed class system TTableSpec=class(Tobject) private FName : string; FDescription : string; FCan_add : Boolean; FCan_edit : Boolean; FCan_delete : Boolean; FFields : array[1..100] of TFieldSpec; public property Name: String read FName; property Description: String read FDescription; property Can_add : Boolean read FCan_add; property Can_edit : Boolean read FCan_edit; property Can_delete : Boolean read FCan_delete; property Fields : array read FFields; end; Thus in TableSpec Fields property shall be the list of fields (I used TFieldSpec array). How to organize the list of fields (using

Delphi 2010 Tablet PC Support

こ雲淡風輕ζ 提交于 2019-12-05 02:25:56
问题 One of the big selling points I saw when I had to buy delphi for my job was the ability to support tablet pc's. Now the client of the company where I work want to use a tablet pc. I've been trying hard to find examples of delphi with tablet pc but I don't find any. Does anybody has experience with it? Any kind of tutorials or examples? I don't seem to be able even to bring a virtual keyboard when a component gain focus and hide it when it loses it. 回答1: Delphi 2010 introduced some nice touch