delphi-7

chr equivalent for Unicode in Delphi 7

旧巷老猫 提交于 2019-12-11 02:31:55
问题 I need to initialize a Widestring in Delphi 7 but I can't use chr function which is ANSI var ws : Widestring; begin ws := chr($FFFF) + chr($FFFF) + chr($FFFF); end; What can I use, then ? Thanks 回答1: I'm not sure there's a simply way to do what you wish. You can convert a Word into a WideChar with a simple cast: WideChar($FFFF) but you cannot concatenate WideChar . So this is a compiler error: WideChar($FFFF) + WideChar($FFFF) You could use a helper function to get the job done: function

RegEx replacing IMG src attributes

久未见 提交于 2019-12-11 02:07:05
问题 I have a var baseURL that I know is: baseURL = c:\whatever\mybasedir\ I have an HTML source code that may contain this: <IMG alt="foo" src="file://c:\whatever\mybasedir\root\foo\bla.gif"> or/and: <IMG alt="foo" src="file://c:/whatever/mybasedir/root/foo/bla.gif"> or/and: <IMG src="c:\whatever\mybasedir\root\foo\bla.gif"> or/and: <IMG src="c:\whatever\mybasedir/root/foo/bla.gif"> I need to replace all src tags so that result path is Unix style relative to baseURL : <IMG src="root/foo/bla.gif">

Delphi 7 - How to delete an item from listview using its caption

白昼怎懂夜的黑 提交于 2019-12-11 01:47:15
问题 i'm trying to delete a listview item based into caption, but I can not find a solution for this, the only way I can delete an item is using the index: listview1.Items.Delete (0); Can anyone help me to delete an item through the caption? 回答1: You can use something like this, which attempts to locate a ListItem with the caption Item 2 , and deletes it if it find it: procedure TForm1.Button1Click(Sender: TObject); var LI: TListItem; begin LI := ListView1.FindCaption(0, 'Item 2', False, True,

Delphi 7 Glyph.Data Hex to Data URI [closed]

血红的双手。 提交于 2019-12-10 23:37:09
问题 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 . I'm trying to convert a Delphi-7 ui to a webinterface. Delphi stores button icons in the property Glyph.Data as a hexadecimal string. For example: object Btn1: TSpeedButton Left = -1 Top = -1 Width = 26 Height = 27 Anchors = [akTop, akRight] Flat = True Glyph.Data = {

Does TWebBrowser updates with IE?

老子叫甜甜 提交于 2019-12-10 23:33:44
问题 I use TwebBrowser in a D7 app. The question is: When I upgrade my IE this component will use the new IE to render the pages? 回答1: Yes. TWebBrowser inside of the SHDocVw unit internally creates a IWebBrowser2 OLE control. And this interface uses the the installed Internet Explorer (as described here). 回答2: Yes it does. When it's created, it requests the system for an instance of the object that is currently configured to implement IWebBrowser2 ({0002DF01-0000-0000-C000-000000000046}) which

How to use Interface with VCL Classes?

邮差的信 提交于 2019-12-10 23:10:59
问题 In my previous question I was suggested to use Interface: How to implement identical methods with 2 and more Classes? But nothing complies as I have no knowledge on how to use Interfaces. I guess you can call this code pseudo :) type IDoSomething = interface ['{EFE0308B-A85D-4DF3-889C-40FBC8FE84D0}'] procedure DoSomething1; procedure WMSize(var Message: TWMSize); message WM_SIZE; // <- Unknown directive: 'message' end; TMyCheckBox = class(TCheckBox, IDoSomething) // <- Undeclared identifier:

Is there any way to get code folding in Delphi 7?

风格不统一 提交于 2019-12-10 22:37:23
问题 I know this is a long shot - but is there any way at all to get code folding into Delphi 7? I'm working on some .. "suboptimal" .. code. Sometimes I really need to fold bits away to grok a stupid-long procedure. Currently I'm pasting code into Notepad++, which works, but it would be nice to have it in the IDE. 回答1: Look for "method folding" on this FAQ (for GExperts) and you'll see that even this team, which has added many enhancements to Delphi, doesn't think this is in the cards for Delphi

Windows API Parameters in Delphi - passing var parameter with or without @ operator?

十年热恋 提交于 2019-12-10 22:29:03
问题 I'm trying to use a function that calls SetupDiGetDeviceRegistryProperty with Delphi 7. The call is from the example function SetupEnumAvailableComPorts. It looks like this: SetupDiGetDeviceRegistryProperty( DevInfoHandle, DeviceInfoData, RegProperty, @PropertyRegDataType, nil, 0, @RequiredSize ); I get the error "Types of actual and formal parameters must be identical" on the parameters @PropertyRegDataType, and @RequiredSize. These parameters are declared: var RequiredSize: Cardinal;

How to set THTTPRio.Converter.Options to soLiteralParams in OnBeforeExecuteEvent

风格不统一 提交于 2019-12-10 22:10:35
问题 This refer to the post Delphi SOAP Envelope and WCF. Could someone please post a sample code which can show me how to set soLiteralParams in THTTPRio.Converter.Options in Delphi 7. I have the following code currently. I have drag-dropped a HTTPRIO component into the document which has created a line HTTPRIO1: THTTPRIO at the beginning of the code. I basically want to understand how I set soLiteralParams in the above component. Following is the code I am trying to execute which is giving me

TImage does not seem to support Jpeg in D7 (free edition)?

人盡茶涼 提交于 2019-12-10 20:20:11
问题 procedure TmainForm.FormCreate(Sender: TObject); var img : TImage; pic:TPicture; begin pic := TPicture.create(); pic.LoadFromFile('my_picture.jpg'); img := Timage.create(Self); img.Picture := pic; end; ... "Project MyProect.exe raised exception class EInvalidGraphic with message 'Unknown picture extension (.jpg)'" and, sure enough, right there in function TPicturePropertyEditor.Execute() it only handles .ICO and .BMP files! The weird thing is that if I place a TImage on a form at design time