NeoSoft Support Forum Forum Index  Your source for Plug-Ins, sample publications, source code and more...

Source Language:
Translate to:

NeoSoft Support Forum
NeoSoft Community Support Forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   SmartFeedSmartFeed   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

NBInterface Question

 
Post new topic   printer-friendly view   Reply to topic    NeoSoft Support Forum Forum Index -> General NeoBook Discussions
View previous topic :: View next topic  
Author Message
David de Argentina
NeoBooker


Joined: 04 Apr 2005
Posts: 930
Location: Buenos Aires, Argentina

PostPosted: Mon Feb 08, 2010 2:26 pm    Post subject: NBInterface Question Reply with quote

Hi Dave,

I'm trying to work with the NBInterface feature within my plugins.

For general rule, I use this:

a) there are some interfaces that not use Data or send NIL Data: basically the interfaces that open some dialogs like Action Editor or Color Selector. The SDK Help file shows something like this:
Code:
VAR Data : PCHAR;
BEGIN
  Data := NIL;
  nbInterface( 3, Data );
  ShowMessage( StrPas( Data ) );
  FreeStr( Data );
END;

b) There are some interfaces that must use any kind of Data, Like the object selector editor (Interface 1) or the Interface to get the window handle of any object (Interface 7). The SDK Help file shows something like this:
Code:
VAR Data : PCHAR;
BEGIN
  SetStr( Data, 'ObjectType=2' );
  nbInterface( 1, Data );
  ShowMessage( StrPas( Data ) );
  FreeStr( Data );
END;


Ok. When Interface does not use Data, PowerBasic convertion code works fine.
But, when interface uses some kind of Data, I don't find the way to send this data in order to retreive Interface actions.

I understand SetStr function is used to inform to NeoBook main enviroment of develop, the contents of some values on edition time, but on this samples I don't understand the difference between this:

SetStr( Data, 'ObjectType=2' );
nbInterface( 1, Data );

and this:

Data:="ObjectType=2";
nbInterface( 1, Data );

In order to set PowerBasic code properly.

Are there any C (or C++) sample that uses this interfaces in order to try to learn the correct way to use this ?

Thanks in advance,
David de Argentina
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Neosoft Support
NeoSoft Team


Joined: 31 Mar 2005
Posts: 4058
Location: Oregon, USA

PostPosted: Tue Feb 09, 2010 11:36 am    Post subject: Reply with quote

Since a plug-in is a type of DLL, any string information passed to NeoBook must be in the form of a pointer. The SetStr procedure allocates memory for the Data PCHAR and copies the string into it. The PCHAR is then passed to the nbInterface procedure. NeoBook may modify the PCHAR and return it to the plug-in. Finally, the plug-in calls FreeStr to release the memory allocated for the PCHAR.

If part of this isn't working with PowerBasic, then you may want to look at the SetStr procedure (part of the plug-in template) and see if it needs any modification. I'm sorry, I am not a PowerBasic programmer.
_________________
NeoSoft Support
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    NeoSoft Support Forum Forum Index -> General NeoBook Discussions All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Forum content © 2008 NeoSoft Corp. All rights reserved.