View Issue Details

IDProjectCategoryView StatusLast Update
0003314Far ManagerPlugins APIpublic2016-09-28 11:49
Reporterpepak Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status newResolutionopen 
Product Version3.0 
Summary0003314: PluginsControl needs a simple method for calling plugins
DescriptionI can't find any easy way for my plugin to call another plugin. As far as I can tell, the only way I can reliably do it involves:

1) Find a plugin with PCTL_FINDPLUGIN.
2) Get its information with PCTL_GETPLUGININFORMATION.
3) If the plugin is loaded...
4) Use its ModuleName with LoadLibrary and GetProcAddress to get address of the OpenW function.
5) Prepare an OpenInfo structure with the necessary data.
6) Call OpenW.

I would appreciate a simpler method. While the above is universal, one doesn't usually need all the power of OpenW - a simple call to pass a command-line to a plugin would satisfy most needs. Particularly since that simple interface would let me run a native (non-plugin) command line as well, which is apparently not possible with the current API.
TagsNo tags attached.
Build

Activities

JohnDoe

2016-09-27 18:13

updater   bugnote:0014816

a simple call to pass a command-line to a plugin would satisfy most needs.

pepak
MCTL_EXECSTRING + Plugin.Command

pepak

2016-09-27 19:31

reporter   bugnote:0014817

It was my understanding that this would require a plugin to support macro calls. Am I mistaken?

Can Plugin.Command be used to execute a command line in the context of standard (non-plugin) panel, too?

JohnDoe

2016-09-28 08:13

updater   bugnote:0014818

Last edited: 2016-09-28 08:13

It was my understanding that this would require a plugin to support macro calls

pepak
Plugin.Call requires, Plugin.Command and Plugin.Menu don't

Can Plugin.Command be used to execute a command line in the context of standard (non-plugin) panel, too?

pepak
All should behaves same as user input in command line

pepak

2016-09-28 09:07

reporter   bugnote:0014819

Plugin.Command works nicely, even though it only replaces steps 4-6 above. Thanks for the hint.

My second question was perhaps poorly formulated. What I meant is, is it possible to execute a command line not through a plugin, but through FAR Manager itself? The distinction being, "edit:<for /?" is a plugin command while "cd c:\windows" is a FAR command (possibly passed to the underlying operating system). Is there a special GUID for FAR itself? I tried all zeroes, but apparently that is not correct.

JohnDoe

2016-09-28 11:44

updater   bugnote:0014820

Last edited: 2016-09-28 11:49

it only replaces steps 4-6 above.

pepak
I wonder why do you ever need steps 1..3
Plugin Id is constant, and you can find if it is loaded by analysing returned values of MCTL_EXECSTRING

is it possible to execute a command line not through a plugin, but through FAR Manager itself?

pepak
It's not possible now.
But you can emulate user input with macro (MCTL_SENDSTRING).
Like this:
print "edit:<for /?"
Keys "Enter"

Issue History

Date Modified Username Field Change
2016-09-27 15:47 pepak New Issue
2016-09-27 18:13 JohnDoe Note Added: 0014816
2016-09-27 19:31 pepak Note Added: 0014817
2016-09-28 08:13 JohnDoe Note Added: 0014818
2016-09-28 08:13 JohnDoe Note Edited: 0014818
2016-09-28 09:07 pepak Note Added: 0014819
2016-09-28 11:44 JohnDoe Note Added: 0014820
2016-09-28 11:46 JohnDoe Note Edited: 0014820
2016-09-28 11:49 JohnDoe Note Edited: 0014820