Delphi

Delphi 2010 Cryptography libraries [closed]

心不动则不痛 提交于 2019-12-30 04:47:08
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . can you recommend an open source Delphi crypto library that works with Delphi 2006, Delphi 2009 & Delphi 2010 Algorithms need : DES, MD5, SHA-1 回答1: Here is a short list of the libraries I have used both pre and post D2009: TPLockbox (I use an unofficial updated version. Although there is a recent official(?)

Delphi: Accessing JSON Objects within a JSON Array

◇◆丶佛笑我妖孽 提交于 2019-12-30 04:38:18
问题 I have a JSON Object, let's name it jObject that looks like this: { "id": 0, "data": "[{DAT_INCL: \"08/03/2012 10:07:08\", NUM_ORDE: 1, NUM_ATND: 1, NUM_ACAO: 2, NUM_RESU: 3}, {DAT_INCL: \"08/03/2012 10:07:09\", NUM_ORDE: 2, NUM_ATND: 1, NUM_ACAO: 4, NUM_RESU: 5}, {DAT_INCL: \"08/03/2012 10:07:09\", NUM_ORDE: 3, NUM_ATND: 1, NUM_ACAO: 8, NUM_RESU: NULL}]" } As you can see, it contains two pairs, one of which is an array with three objects in this case (the amount of objects is dynamic) with

How to pass multiple file extensions to TDirectory.GetFiles?

て烟熏妆下的殇ゞ 提交于 2019-12-30 04:25:06
问题 TDirectory.GetFiles has a parameter called SearchPattern. Embarcadero's documentation says The mask used when matching file names (for example, "*.exe" matches all the executable files). However, I want to pass multiple file types. I get those types from a FilterComboBox.Mask . So, it is a string that looks like '*.txt;*.rtf;*.doc' . I have tried to pass that string directly to GetFiles and it doesn't work. Do I have to parse it, break it into pieces and feed every individual piece to

Are there any cryptographically secure PRNG libraries for Delphi? [closed]

北城以北 提交于 2019-12-30 04:24:33
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Can anyone recommend a cryptographically-secure pseudo random number generator library for Delphi (Win32)? Can be free or commercial, but will ideally be an active project. I'd like it to include source code. 回答1: You can use Windows CryptoAPI: uses Wcrypt2; function GenerateRandom(Len: Cardinal): TBytes; var

get the full path from a PID using delphi

风流意气都作罢 提交于 2019-12-30 04:11:10
问题 I need to get the full path from a PID. I've checked this question C++ Windows - How to get process path from its PID and I wrote the following code: function GetFullPathFromPID(PID: DWORD): string; var hProcess: THandle; ModName : Array[0..MAX_PATH + 1] of Char; begin Result:=''; hProcess := OpenProcess(PROCESS_ALL_ACCESS,False, PID); try if hProcess <> 0 then if GetModuleFileName(hProcess, ModName, Sizeof(ModName))<>0 then Result:=ModName else ShowMessage(SysErrorMessage(GetLastError));

Calling functions from a c++ DLL in Delphi

纵饮孤独 提交于 2019-12-30 04:02:33
问题 I created a new c++ DLL project in VS2010 that exposes 1 function #include "stdafx.h" #define DllImport extern "C" __declspec( dllimport ) #define DllExport extern "C" __declspec( dllexport ) DllExport int DoMath( int a, int b) { return a + b ; } I then created a C++ application with VS2010 to test this DLL. The test application build in VS2010 could call the c++ DLL and get the expected result. #include "stdafx.h" #include <windows.h> typedef int (*DoMath)(int, int) ; int _tmain(int argc,

Indy 9 + Delphi 2007 latest SSL Libraries available?

血红的双手。 提交于 2019-12-30 03:29:16
问题 When using Delphi 2007 along with Indy 9, what are the latest OpenSSL libraries that can be loaded and where are they available? 回答1: You need the following two DLLs: libeay32.dll ssleay32.dll You can download the source from the open-source organization OpenSSL.org, but then you have to compile the DLLs yourself. Indy maintains a site of compiled binaries for each version of Indy and OpenSSL (see indy.fulgan.com/SSL and indy.fulgan.com/SSL/Archive -- thanks to TLama for the links). Older

Synchronization for multiple readers, single writer?

不打扰是莪最后的温柔 提交于 2019-12-30 03:28:04
问题 Another synchronization question...I hope you guys don't get annoyed ;) Assume the following scenario: one central data structure (very large, so I don't really want to make it immutable and copy it around whenever a change occurs. I even don't want to keep multiple copies in memory), multiple reader threads that access that data structure read-only and one writer thread which keeps the data structure up to date in the background. I currently synchronize all accesses to the data structure,

Delphi Class of in C#

▼魔方 西西 提交于 2019-12-30 03:12:05
问题 I know this question has been asked before, but I have yet to see a short, clear answer, so I'm hoping they won't remove this question and I will now get a clear answer: I am currently working in C# 5.0; .NET 4.5; VS 2012. I am mostly a Delphi guy although I've done lots with C#. In Delphi I have written hundreds of class factories that use the following sort of design (MUCH SIMPLIFIED HERE): unit uFactory; interface type TClassofMyClass = class of TMyClass; TFactoryDict = TDictionary<TMyEnum

Is there a benefit in using old style `object` instead of `class` in Delphi?

≯℡__Kan透↙ 提交于 2019-12-30 03:11:09
问题 In Delphi sane people use a class to define objects. In Turbo Pascal for Windows we used object and today you can still use object to create an object. The difference is that a object lives on the stack and a class lives on the heap. And of course the object is depreciated. Putting all that aside: is there a benefit to be had, speed wise by using object instead of class? I know that object is broken in Delphi 2009, but I've got a special use case 1) where speed matters and I'm trying to find