Source language: Translate to:

Is possible to get the actions from a NBP file?

Questions about NeoBook PlugIns

Moderator: Neosoft Support

Is possible to get the actions from a NBP file?

Postby dec » Sun Sep 11, 2011 4:05 am

Hi there!

I ask for the possibility of retrieve the actions that a plugin plugin file (NBP) contain. I think this is not possible, because, the NBP (in fact a Windows DLL) dont export this information, but, I am wrong? Is possible to get this information? And how...

Thanks in advance for your suggestions, comments or whatever else. :)
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby HPW » Sun Sep 11, 2011 6:33 am

Hello,

When it is a standard NBP you would have to write a programm which would call the same register-function like the neobook.exe does.

For what do you need this?
You should know the commands of your own plugins.
Some of my pluguns have a special function for the export of this info to let newlisp or other foreign languages import the neobook commands automaticly.

See this post from 2004:
http://www.neosoftware.com/forum/viewto ... ht=cmdlist


Hans-Peter
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby dec » Sun Sep 11, 2011 6:57 am

Hi Hans,

Thanks for your answer. I not well understand:

When it is a standard NBP you would have to write a programm which would call the same register-function like the neobook.exe does.


First of all, can be a NBP not standard? For the other hand, I think what you point me on the right direction when said something like "If NeoBook program can do, you can do too". But how?

Maybe calling "nbRegisterPlugIn" exported function? You know that from here you can add plugin actions using "nbAddAction" function, but, how a program (not than NeoBook) can finally get the plugin action list?

Think on a lot of plugins -a lot maybe more than 300 plugins. Maybe you want to know what actions are in these plugins, in order to decide what can be use or not. So a program that can list the plugin actions can be useful, over all if we are talking about 300 plugins or more.

I read the thread you link and appear to be good, but, is not right for the case that we are talking about, because not all the plugins export some kind of information to retrieve their actions list. For example my plugins dont export this kind of information. May can be a good point to export, but first we need to choose exactly what are exported and in what manner.

Finally, I repeat that you point me on the right way saying that NeoBook can retrieve the actions list from a plugin, so others program can do it, but, at this time I dont know how to achieve this, because I'm lost about what interfaz function(s) can be used and how. What do you thing Hans?

Thanks!
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby HPW » Sun Sep 11, 2011 7:15 am

.... can be a NBP not standard?


It also gives the NBR flavour which does dot contain this information.

And yes I mean nbRegisterPlugIn to call directly.

But I have not tried to code such a programm myself, since I had no need to do so.
So looking at the function definition should give a hint how to call such an imported function.
And we could wait for a comment from neosoft, since they know for sure how to call this function
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby dec » Sun Sep 11, 2011 7:37 am

Hi,

Ok, the NBR version of a plugin, but this is not a "non estandard NBP", its just the NBR. :)

For the other hand, looking on "nbRegisterPlugIn" I dont get the way, because as you know on this function you conform the plugin menu, that is, call repeatly to "npAddAction" in order to add the plugin actions and actions categories.

So, suppose I call "npRegisterPlugIn" function, in fact this dont return anything (really is not a function, but a procedure as you know) so, how to hell get from here the plugin actions list?

Maybe some DLL actions hook? Or a program that call to "nbRegisterPlugIn" and get data from "nbAddAction"? Hum... a program that act like NeoBook just for this... a program attach the DLL in the manner that can call one function and receive data from another...

Thanks again!
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby dec » Sun Sep 11, 2011 8:05 am

Hi!

Finally I do it Hans!

Code: Select all
unit UMainForm;

interface

uses
  Forms, Classes, Controls, StdCtrls;

type
  TRegisterPlugInProc = procedure( addActionProc,
    addFileProc, varGetFunc, varSetFunc : Pointer );

type
  TMainForm = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    RegisterPlugInProc : TRegisterPlugInProc;
  end;

var
  MainForm: TMainForm;

implementation

uses
  Windows;

{$R *.dfm}

procedure MyVarSetProc( name, value : PChar );
begin
  //
end;

procedure MyVarGetProc( name : PChar; var value : PChar );
begin
  //
end;

procedure MyAddFileProc( fileName : PChar; addFlag : boolean );
begin
  //
end;

procedure MyAddActionProc( id : integer; name, hint : PChar; params : array of byte; totalParams : byte );
begin
 // Conform the list from the plugin here!
end;

procedure TMainForm.Button1Click(Sender: TObject);
var
  DLLHandle : THandle;
begin
  DLLHandle := LoadLibrary( 'a.nbp' );

  if DLLHandle <> 0 then
  begin
    @RegisterPlugInProc := GetProcAddress(DLLHandle, 'nbRegisterPlugIn');

    RegisterPlugInProc( @MyAddActionProc, @MyAddFileProc, @MyVarGetProc, @MyVarSetProc );

    FreeLibrary( DLLHandle );
  end;
end;

end.


So thanks very much Hans to point me on the right direction! :)
Last edited by dec on Sun Sep 11, 2011 8:09 am, edited 1 time in total.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby HPW » Sun Sep 11, 2011 8:09 am

Hi,

You are right. I just take a look in one of my plugin source.
It is really not easy to understand the neobook plugin interface.
That was the reason why I made a more simple one in the past for newlisp etc.
The neobook interface is very neobook and delphi specific.

Maybe neosoft can provide a piece of code for you to get such a list.

Oops, my answer seems a bit too late, since you solved your problem.
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby dec » Sun Sep 11, 2011 8:14 am

HPW wrote:Oops, my answer seems a bit too late, since you solved your problem.


With your help. Dont forget it! :)
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby dec » Sun Sep 11, 2011 12:07 pm

Hi!

Take a look if you like:

http://neoplugins.com/nbplist.php

Thanks!
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby HPW » Sun Sep 11, 2011 2:05 pm

Hi David,

Nice work. Can be usefull.

3 suggestion:

A button to save the folder list.

A toggle for "Include sub-folder"

A option for a CSV-file export/format to allow import for example into excel

regards

Hans-Peter
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby dec » Sun Sep 11, 2011 2:06 pm

Hello Hans,

Good suggestions. I note it for future versions. :)

P.S. Note that right now the program look for subfolders too.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby dec » Sun Sep 11, 2011 2:19 pm

Hi!

Download NBP List again: I just add a "load" and "save" folders buttons and a "Search for subfolders" checkbox. The CSV-file export/format addition must need wait for now. :)
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby HPW » Sun Sep 11, 2011 2:22 pm

Hello,

Oops, on my first try I thought that it hang on my main plugin folder on my tablet.
But now I try it again on the 30 plugins/669 actions and it works.

Thanks again.
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby dec » Sun Sep 11, 2011 3:21 pm

Hi there!

Just for fun! :D

Edit: I remove the actions list from here, because the content is greater than the post admit. :)
Last edited by dec on Mon Oct 24, 2011 10:40 am, edited 4 times in total.
.
Enhance your NeoBook applications!
.
58 plugins, 1131 actions and 233 samples
.
NeoPlugins website: www.neoplugins.com
.
User avatar
dec
 
Posts: 1663
Joined: Wed Nov 16, 2005 12:48 am
Location: Spain

Postby Wrangler » Sun Sep 11, 2011 3:35 pm

Access violation at address 0432d149 in module activelock1884.nbp. Read of address 00000024.

Running win7 64bit.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour

Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
User avatar
Wrangler
 
Posts: 1507
Joined: Thu Mar 31, 2005 11:40 pm
Location: USA

Next

Return to PlugIn Discussions

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest