toolsapi

How do I get the version number of the current project using ToolsAPI in Delphi 10.2

北城余情 提交于 2020-01-23 07:34:39
问题 In Delphi 2007 I can easily get the version information of the current project using the following ToolsAPI calls: procedure Test; var ProjectOptions: IOTAProjectOptions; Project: IOTAProject; Major: Variant; Minor: Variant; Release: Variant; Build: Variant; begin // GxOtaGetCurrentProject is a function in GExpert's GX_OTAUtils unit that returns the current IOTAProject Project := GxOtaGetCurrentProject; if Assigned(Project) then begin ProjectOptions := Project.ProjectOptions; if Assigned

Adding a unit automatically to the project

血红的双手。 提交于 2020-01-21 05:06:10
问题 I am working on a component in Delphi 7 and Delphi 2006 , where I am using a unit which I need to add to the .dpr file of the project on which the component is dropped automatically. Like the way Eureka Log automatically adds the unit 'ExceptionLog' to the project file: Can anyone tell me how to programmatically add a unit to the project file when I drop my component on any form in the project? 回答1: You most likely have to use the Open Tools API for that. Also it might require to write a

Adding a unit automatically to the project

不羁的心 提交于 2020-01-21 05:05:06
问题 I am working on a component in Delphi 7 and Delphi 2006 , where I am using a unit which I need to add to the .dpr file of the project on which the component is dropped automatically. Like the way Eureka Log automatically adds the unit 'ExceptionLog' to the project file: Can anyone tell me how to programmatically add a unit to the project file when I drop my component on any form in the project? 回答1: You most likely have to use the Open Tools API for that. Also it might require to write a

How to implement IOTAProjectCompileNotifier of Delphi's ToolsAPI?

∥☆過路亽.° 提交于 2019-12-30 07:28:18
问题 I am using Delphi XE IDE. I create a notifier to implement IOTACompileNotifier. After install the expert in the IDE. The code works fine when I compile my project. The notifier is working for ProjectCompileStarted. The second time I compile my project, the Delphi IDE prompt: [Fatal Error] Access violation at address 21B7FBED in module 'delphicoreide150.bpl'. Read of address 00000000 Although it seems weird that I perform: var i: integer; begin i := Project.ProjectBuilder.AddCompileNotifier

How to highlight a specific line in source editor using OpenToolsAPI

笑着哭i 提交于 2019-12-21 17:19:13
问题 Is it possible to highlight a specific line in active editor window just like Delphi IDE does when highlighting compiler errors? 回答1: If it's OK to just go to a certain line in the topmost editor then try this: procedure GotoLine(LineNumber: Integer); var EditorServices: IOTAEditorServices; Buffer: IOTAEditBuffer; Position: IOTAEditPosition; begin if not Supports(BorlandIDEServices, IOTAEditorServices, EditorServices) then Exit; Buffer := EditorServices.TopBuffer; if not Assigned(Buffer) then

How to preserve code folding when formatting source

自作多情 提交于 2019-12-13 03:59:49
问题 See also this question: How do I avoid expanding folded regions when I invoke the code formatter? This is not a dupe, because I'm interested in solving the problem using the ToolsApi. When I press CTRL + D the code formats nicely (mostly) . But all my folded code sections get unfolded. Is there a way to keep these sections folded. If not, is it possible to save the code folding info prior to formatting, so I can restore it later? I'm thinking of writing IDE-addin using the Open Tools api. I'm

Replace manifest during compilation

天大地大妈咪最大 提交于 2019-12-12 00:27:48
问题 I want to create IDE extension which allows me to edit Windows manifest directly in Delphi IDE. Is there a way to delete build in manifest and add my own resource without {$R} directive? All my tryings with IOTAProjectResource were failed. I even could not get this interface from IOTAProject. I use Delphi XE3. 来源: https://stackoverflow.com/questions/20819974/replace-manifest-during-compilation

Add my own items to Delphi IDE Insight (F6) with in Delphi Open Tools API

会有一股神秘感。 提交于 2019-12-08 22:05:21
问题 I want to use INTAIDEINsightService perhaps AddItem or AddActionList to add an entry to the IDE insight feature in Delphi. According to the Delphi OTA wiki, INTAIDEINsightService allows you to register your own action. The only reference I can find is here, which mentions the name of the API, and that it exists at all. There is nothing in the Delphi help about it. The ToolsAPI.pas unit in Delphi XE shows two methods in this interface that let you register actions: function AddActionList(

How I can detect when the modules window is open in the Delphi IDE?

女生的网名这么多〃 提交于 2019-12-07 05:24:16
问题 I'm writing a Delphi plugin and I need detect when the Modules (View - Debug windows - Modules) window is open (attached to IDE Editor). I'm using the IOTAEditorNotifier to get notified when a new Editor window is open, but only works for source files. This is the code used to receive the notifications from the IDE Editor. uses Classes, SysUtils, ToolsAPI; type TSourceEditorNotifier = class(TNotifierObject, IOTANotifier, IOTAEditorNotifier) private FEditor: IOTASourceEditor; FIndex: Integer;

How do I get Welcome Page browser navigate to some URI from within OTA package wizard?

假装没事ソ 提交于 2019-12-06 20:50:33
问题 What I'm trying to do is to create an ability to view (not to edit) the HTML pages included into project. The Welcome Page already has embedded web browser, so it appears to be a good candidate for that. Curios why? Here is a question with background info. 回答1: In case you're willing to use a hack like this: type TOpenNewURLModule = procedure(const URL: string; EditorForm: TCustomForm); procedure OpenURL(const URL: string); var EditWindow: INTAEditWindow; Lib: HMODULE; OpenNewURLModule: