Source language: Translate to:

Is possible to get the actions from a NBP file?

Questions about NeoBook PlugIns

Moderator: Neosoft Support

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

Hi,

I just get a report from an Neobooker that the NBP List program dont work for some plugins (in fact he send me three wrong plugins, but I think this NeoBooker has many more). One of this maybe cannot export the actions to NeoBook like NBP List program expected. Another one appear equals, but I canot be installed on NeoBook, so... and the other are much rare, because hang NBP List and even Delphi: I cannot debug it, because the proccess appear "not accesible".

Wrangler, you said about a "activelock1884.nbp" access violation. I think this is related with the plugin and not with NBP List. In fact the NBP List program expect that the plugin add actions to NeoBook just on the common place for doing this. But plugins developers can add actions on other places, and do anything (repeat, anything) on their plugins code (for example, test if is NeoBook that use it)... then crash NBP List.

Sorry for that.
.
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 11:00 pm

Hello David,

Just ran it on my office pc and get also one access violation.
But this is clear to me why it may crash.
It is billenium transition plugin which does not have real neobook commands but has the special transition plugin interface.
So may be you can catch this error.
Not sure how it react on the call.
You may check if the nbRegisterEffect function exist and report that it is a transition plugin.
Or even report the effects. ;-)



Another idea would that you also call nbInitPlugIn to get PlugInTitle, PlugInPublisher and PlugInHint for the report.

Code: Select all
PROCEDURE nbInitPlugIn( WinHandle : HWND; VAR PlugInTitle, PlugInPublisher, PlugInHint : PChar ); FAR;
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby FM » Mon Sep 12, 2011 9:11 am

I have the same access violation from BTN.nbp (Billenium Transitions)
FM
 
Posts: 90
Joined: Tue Nov 21, 2006 12:50 am

Postby Wrangler » Mon Sep 12, 2011 9:18 am

Problem is, if you have one incompatible plugin in your plugins folder, you don't get info for any of them. Would be good if you could capture the incompatibility error and move on to the next one if found.
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

Postby HPW » Mon Sep 12, 2011 9:41 am

Hi,

the BTN-error does not stop the process.
And it should be possible to catch it by checking for the other function.
Since David uses the official SDK-call it should work with most plugins.
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Neosoft Support » Mon Sep 12, 2011 11:32 am

Most likely the plug-ins that fail are written in C, C++ or PowerBasic. Since DLLs written in those languages use a different calling convention you need to use an alternate set of procedures. For example:

Delphi Plug-In:
procedure MyAddActionProc( id : integer; name, hint : PChar; params : array of byte; totalParams : byte );

C/PowerBasic Plug-in:
procedure C_MyAddActionProc( id : integer; name, hint : PChar; params : array of byte; totalParams : byte ); STDCALL;

Internally, C/PowerBasic dlls are structured differently too. For example:

Delphi Plug-In:
GetProcAddress( hMod, 'nbInitPlugIn' );

C++/PowerBasic Plug-in:
GetProcAddress( hMod, '_nbRegisterPlugIn@16' );

or

GetProcAddress( hMod, '_nbRegisterPlugIn' );

So to open all possible types of plug-in you need to do something like this:

IF GetProcAddress( hMod, 'nbInitPlugIn' ) <> NIL THEN
BEGIN
// this is a delphi plug-in...
END
ELSE IF GetProcAddress( hMod, '_nbInitPlugIn@16' ) <> NIL THEN
BEGIN
// this is a Microsoft c++ or PowerBasic plug-in...
END
ELSE IF GetProcAddress( hMod, '_nbInitPlugIn' ) <> NIL THEN
BEGIN
// this is a Borland C++ plug-in...
END;
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Postby dec » Mon Sep 12, 2011 12:19 pm

Hi there,

Sorry for the delay, I change my forum account and have an inactive account just to now. As you can see Hans the new release of NBP List can get the name, hint and author name of them.

For the other hand, NeoSoftware put us on the right way. Just now I am busy with other thing, but I take note for future NBP List releases. Thank to all for comments, suggestion, ideas, help, etc.

Cheers!
.
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 » Mon Sep 12, 2011 1:16 pm

Hi,

Well, finally I do some try, but, this appear to taken more time that I have just now. I think not only is needed to use different procedures names, but also provide diferent "callback" procedures, so, I need to think on how to achieve this. Of course any idea are appreciated. :)
.
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 » Tue Sep 13, 2011 4:26 am

Hi,

Well, for now the program can read some non Delphi plugins, for example, Chauvin plugin's.

However, I still with problems (access violation) when try with Billenium Effects plugin.
.
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 » Tue Sep 13, 2011 5:18 am

Hi there!

Well. I try with some Christian Chauvin plugin copy and work fine. But...

Triying others plugins copies you can see something that I said before. In this case the plugins alert the user with a "trial version advise" dialog.

NBP List can retrieve the plugins information, but, cant do anything with alert messages. In fact the place to alert with this kind of messages is not the procedure that NBP List execute.

But as I said before: a plugin developer can do anything on every place: And this is that I want to say: appear very difficult that NBP List work with all of plugins, because this kind of things.

In the case of my plugins the program work like a charm. In fact help me localizing some "missing actions descriptions" in a couple of my plugins (now yet updated). Hans Peters plugins appear to be good too.

But the pourpose of NBP List is to retrieve information from any plugin, and this appear tricky, dirty and dangerous, because in fact we cant know if a plugin show an alert, other terminate the thread, other find if NeoBook is the host, etc., etc., etc.

However, NBP List can try to deal with possible access violations (not in NBP List, just on the plugin, or when interact with the plugin) or reporting plugins that cannot be well accessed. Or maybe another approach can be found in order to begin the begin. :)
.
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 » Tue Sep 13, 2011 5:52 am

However, I still with problems (access violation) when try with Billenium Effects plugin.


Couldn't you simply try
Code: Select all
@RegisterPlugInProc := GetProcAddress(DLLHandle, 'nbRegisterEffect');

and check if ]@RegisterPlugInProc gets a value?

And if not check further for normal plugins with nbRegisterPlugin.

And all other checks go into try...except blocks for error catching.
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby dec » Tue Sep 13, 2011 5:58 am

Hi Hans,

Yes. "nbRegisterEffect" can be found. But I think that the plugin put an access violation in any case. I need to try. Thanks Hans.

For the other hand, try ... except block (I think) dont have sense here, if the access violation occurr on the plugin. But I need to try 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 HPW » Tue Sep 13, 2011 6:50 am

Yes. "nbRegisterEffect" can be found. But I think that the plugin put an access violation in any case. I need to try. Thanks Hans.


It should only check if it exist, not call it.
So this should do nothing in the plugin.

With the try ... except I am not sure if it will work, but it is worth a try.
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby dec » Tue Sep 13, 2011 7:19 am

Hi Hans,

Well. The first work, the second not. Try the latest NBP List release, now the program can recognize "Effects" plugin and report it. But try ... except dont work at all.

An example. I try to load information from "NeoSQLite3.nbp" plugin, and the plugin raise with a dialog saying "SQL is not installed, install it and...". The try ... except dont work here.

For the other hand, I has reported by an user that have more than 350 plugins and NBP List retrieve their information without errors. So, maybe some plugins can be difficult to get, but, a minory.

Because the program objective is to retrieve the information of plugins in order to can found what action and for what contain the plugins, I think that if a couple of plugins "fails", is not a big problem, because you can get the information "manually".

In any case NBP List can be enhanced in many forms. For example exporting the information to some file formats. And also need a deep refactoring, so I can "play" with it some more.
.
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 » Tue Sep 13, 2011 7:42 am

An example. I try to load information from "NeoSQLite3.nbp" plugin, and the plugin raise with a dialog saying "SQL is not installed, install it and...". The try ... except dont work here.


Of cource it will not work there, since that is a valid code execution.
Maybe the plugin-author should rethink his decision to put that dialog there into the register process.
But anyway that does not hurt much.
NBPlist stays a usefull tool in the toolbox.

PS: For effect plugins you can still report title, publisher and hint.
Hans-Peter
User avatar
HPW
 
Posts: 2520
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

PreviousNext

Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 1 guest