delphi-2007

Delphi Chromium - Iterate DOM

假装没事ソ 提交于 2019-12-01 09:01:40
I'm trying to iterate the DOM using TChromium and because i use Delphi 2007 i can't use anonymous methods, so i created a class inherited of TCEFDomVisitorOwn. My code is as below, but for some reason the 'visit' procedure is never called, so nothings happens. unit udomprinc; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ceflib, cefvcl; type TForm1 = class(TForm) Chromium1: TChromium; procedure FormCreate(Sender: TObject); procedure Chromium1LoadEnd(Sender: TObject; const browser: ICefBrowser; const frame: ICefFrame; httpStatusCode: Integer)

Can I recompile the .PAS files used by the Delphi IDE?

给你一囗甜甜゛ 提交于 2019-12-01 05:51:20
I am familiar with Jeff Atwood's article about how errors are always the programmer's fault , but I believe I have really and truly found a bug in a Delphi .pas file. Specifically, I'm using Delphi 2007, and the error is on line 955 of the DBCommon.pas file, which on my machine is located here: C:\program files\codegear\rad studio\5.0\source\Win32\db\DBCommon.pas And the code is this: ... FieldIndex := StrToInt(Token); if DataSet.FieldCount >= FieldIndex then LastField := DataSet.Fields[FieldIndex-1].FieldName else ... If "Token" has a value of zero, then we try to access index -1 of DataSet

Getting “ÿþI” as output data when reading from a .log file using delphi

不打扰是莪最后的温柔 提交于 2019-12-01 02:35:00
问题 I am trying to read data from a .log file and process its contents. The log file is created by another application. When I use the readln command in Delphi and display the contents of the file in a memo, I only get the one line of data (ÿþI) from a file with over 6000 lines of data. procedure TForm1.Button1Click(Sender: TObject); Var F : TextFile; s : string; begin AssignFile(F, 'data.log'); Reset(F); while not Eof(F) do begin Readln(F, s); Memo1.Lines.Add(s); end; end; Does anyone know what

Saving a Base64 string to disk as a binary using Delphi 2007

北城以北 提交于 2019-12-01 01:32:56
I have a Base64 binary string that is part of an XML document that is sent to us by a 3rd party supplier, I would like to be able to save it back to its original file format (jpg). Using the accepted answer from this question "saving a base64 string to disk as a binary using php" I can save the string to a jpg with little effort, so I know the string is in good form and is a JPG file. But how do I do this in Delphi 2007? Looking on the net I found a tutorial on how to convert the Base64 into a TByteDynArray, and save that, but it doesn't work right. I have also played about with Indy's

Does anyone know about issues between Citrix and Delphi 2007 applications? (And perhaps other development languages?)

蓝咒 提交于 2019-12-01 01:07:12
The situation is simple. I've created a complex Delphi application which uses several different techniques. The main application is a WIN32 module but a few parts are developed as .NET assemblies. It also communicates with a web service or retrieves data from a specific website. It keeps most of it's user-data inside an MS Access database with some additional settings inside the Registry. In-memory, all data is converted inside an XML document, which is occasionally saved to disk as backup in case the system crashes. (Thus allowing the user to recover his data.) There's also some data in XML

Does anyone know about issues between Citrix and Delphi 2007 applications? (And perhaps other development languages?)

夙愿已清 提交于 2019-11-30 20:48:07
问题 The situation is simple. I've created a complex Delphi application which uses several different techniques. The main application is a WIN32 module but a few parts are developed as .NET assemblies. It also communicates with a web service or retrieves data from a specific website. It keeps most of it's user-data inside an MS Access database with some additional settings inside the Registry. In-memory, all data is converted inside an XML document, which is occasionally saved to disk as backup in

How to get information about the computer? [32bit or 64bit]

梦想与她 提交于 2019-11-30 20:03:32
How I can get information about Windows OS type? Is it 32bit or 64bit? How I can get this information programatically? You need to use GetProcAddress() to check the availability of the IsWow64Process() function at runtime, like so: function Is64BitWindows: boolean; type TIsWow64Process = function(hProcess: THandle; var Wow64Process: BOOL): BOOL; stdcall; var DLLHandle: THandle; pIsWow64Process: TIsWow64Process; IsWow64: BOOL; begin Result := False; DllHandle := LoadLibrary('kernel32.dll'); if DLLHandle <> 0 then begin pIsWow64Process := GetProcAddress(DLLHandle, 'IsWow64Process'); Result :=

How to convert classname as string to a class?

◇◆丶佛笑我妖孽 提交于 2019-11-30 17:46:14
问题 I have classnames in a stringlist. For example it could be 'TPlanEvent', 'TParcel', 'TCountry' etc. Now I want to find out the sizes by looping the list. It works to have: Size := TCountry.InstanceSize; But I want it like this: for i := 0 to ClassList.Count - 1 do Size := StringToClass(ClassList[i]).InstanceSize; Obviously my question is what to write instead of method StringToClass to convert the string to a class. 回答1: Since you're using a stringlist you can store the classes there, too:

How to find the smallest and biggest number in an array?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 14:12:45
Hello how can I find the smallest and biggest number in delphi? Suppose I have 10 different numbers stored in an array: How can I find the biggest number and smallest numbers in my array? Simply loop through the array in linear fashion. Keep a variable for the min value and one for the max values. Initialise both to the first value in the array. Then for each element, update the min or max value if that element is less than or greater than the min or max value respectively. minval := a[0]; maxval := a[0]; for i := 1 to Count-1 do begin if a[i]<minval then minval := a[i] else if a[i]>maxval

How to Prevent dialog (Basic Authentication prompt) during call of Webservice

笑着哭i 提交于 2019-11-30 14:11:29
问题 In a delphi program (running as a service) i need to call some webservices. The calls works fine if basic Authentications is not requerired. The calls also works fine if Basic Authentication is requerired and username/password is provided (in BeforePost) using: InternetSetOption(Data, INTERNET_OPTION_USERNAME,... InternetSetOption(Data, INTERNET_OPTION_PASSWORD,... But if Basic Authentication is Requeried, and username/password is not provided, the program brings up af prompt for the username