delphi-xe3

Why can't I return arbitrary array of string?

淺唱寂寞╮ 提交于 2019-12-30 02:30:32
问题 The compiler allows me to do the following: procedure MyProc(const ADynData: array of string); or procedure MyProc(const ADynData: TStringDynArray); and pass arbitrary data like so: MyProc(['Data1', 'Data2']); However, won't allow function MyFunc: TStringDynArray; .... function MyFunc: TStringDynArray; begin Result := ['Data1', 'Data2']; end; or function MyFunc: TStringDynArray; const CDynData: array[0..1] of string = ('Data1', 'Data2'); begin Result := CDynData; end; Why is this? Isn't this

retrieve image saved on database [duplicate]

半世苍凉 提交于 2019-12-28 18:53:21
问题 This question already has answers here : How to insert image into database using TADOQuery Component Only (2 answers) Store images in MS-Access Database using Delphi6 (1 answer) Closed 6 years ago . I'm using this code to load images into my Timage: begin if OpenPictureDialog1.Execute(Self.Handle) then Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName); end; Then I'm using this code to store into my ms access database: var AStream : TMemoryStream; begin Adotable1.Append; AStream :=

Make an installer with Delphi

核能气质少年 提交于 2019-12-25 07:38:16
问题 In my Project I have some files to copy in program files directory and make a shortcut for one executable and other works like an installation. I want to do this in my application with store files in Packages, like CAB files and show installation in a progress bar. First I think about a msi wrapper, but some users said that is so slow! How can I do this in best way? 回答1: Here is a small template for start: unit Unit1; interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics,

Access violation registering Canvas classes

穿精又带淫゛_ 提交于 2019-12-25 07:29:41
问题 I have been getting a few bug reports for an access violation that occurs while registering Canvas classes at startup, more specifically performing an @IntfClear during TCustomDX10Context.CheckDevice . Full bugreport: date/time : 2014-06-04, 18:05:43, 594ms computer name : <...> user name : <...> registered owner : <...> operating system : Windows 7 x64 Service Pack 1 build 7601 system language : English system up time : 54 minutes 48 seconds program up time : 99 milliseconds processors : 4x

Visually creating database tables with the Data Explorer

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-25 03:22:55
问题 I watched a video in relations to creating and working with databases in Delphi. The video states that you can create the database using code, the data explorer or the SQLite3 console application, but I am unable to find out how to create the database using the Data Explorer. Does anyone know a way I can go about doing this? Thank you in advanced. 回答1: The instructions that follow are for XE3, but they should work for XE as well. Right-click on the SQLite item in the Data Explorer, and choose

How to unpack received data in “big endian” into record?

我只是一个虾纸丫 提交于 2019-12-24 15:27:33
问题 I have a record type Treply = record c: integer; b: integer; a: int64; end; I receive data from server using UDP protocol, the data is in "big endian" udp : TIdUDPClient; received_data : TIdBytes; udp.ReceiveBuffer(received_data); How to decode received_data into normal int/int/int64 and put it into record Treply ? Thanks 回答1: In this case, since the record will have no padding, you can simply copy the contents of the buffer onto your record. var Reply: TReply; .... Move(received_data[0],

Delphi-to-C dll: Passing Arrays

故事扮演 提交于 2019-12-24 14:07:16
问题 I'm using Delphi to load a dll (that I created in Delphi XE-3) for the purposes of interfacing with some C code. My problem is figuring out why my arrays aren't being passed to the c functions - they're the only ones not to. The delphi file (simplified) looks like this: program CallcCode uses SysUtils, Windows, DLLUnit in 'DLLUnit.pas'; // Header conversion var DLLHandle: cardinal; n: Integer; A: TArray<Integer>; result1: Integer; begin // Initialize each Array SetLength(A,n); A[0] = ...; //

Cookie Expired Indy

烂漫一生 提交于 2019-12-24 09:13:08
问题 Recently i found that i am getting EConvertError after calling IDHTTP.GET . I analyzed the traffic and saw the expire date on the cookie is 2000. Now my question is how to bypass this. I am using the Indy10 that is present in XE3. I know Indy follows strict standard about cookie handling but shouldn't there be a feature to turn this off ? URL: https://graph.facebook.com/me?access_token=ACCESS_TOKEN StackTrace: :75a5c41f KERNELBASE.RaiseException + 0x58 System.SysUtils.ConvertErrorFmt($412994,

Animated gif in Delphi XE 3 forms [duplicate]

走远了吗. 提交于 2019-12-23 20:05:53
问题 This question already has answers here : Closed 6 years ago . Possible Duplicate: How to use Animated Gif in a delphi form I recently updated my version of Delphi 7 to Delphi XE3 . Using Delphi 7, I used a component to put a GIF on a TImage, delphi XE3 already has compatibility with gif's, it is not necessary to install any additional third party components. my question is: when I attach the gif to TImate, it becomes static, shows only the first frame. is there any command for this? like

Save Cookies inside TIDCookieManager to file

我与影子孤独终老i 提交于 2019-12-23 11:57:35
问题 How can I save cookies inside TIdCookieManager to a file so that they can be used later? Like browser cookies. 回答1: TIdCookieManager does not have any native support for persisting cookie data in files. You have to implement that manually. Use the TIdCookieManager.CookieCollection property to access the list of cookie objects. For example: uses ..., IdCookie, IdCookieManager; var Cookies: TIdCookieList; Cookie: TIdCookie; I: Integer; begin Cookies := IdCookieManager.CookieCollection