Plugin-Based Apps

Share your advanced PureBasic knowledge/code with the community.
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Plugin-Based Apps

Post by Inf0Byt3 »

Here is a quick demonstration on how to make your program support plugins. It's quite easy to do and it can be extended really fast. Demo code and sources included. Hope it's useful.

Use at your own risk.

Here it is:
File:1->Plugin_Based_App.rar
Image
Last edited by Inf0Byt3 on Mon Oct 20, 2008 9:23 pm, edited 2 times in total.
JCV
Enthusiast
Enthusiast
Posts: 580
Joined: Fri Jun 30, 2006 4:30 pm
Location: Philippines

Post by JCV »

Very nice and simple to understand.
Thanks! ;)
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

No problem :D. I'm glad it's usefull.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
CSAUER
Enthusiast
Enthusiast
Posts: 188
Joined: Mon Oct 18, 2004 7:23 am
Location: Germany

Post by CSAUER »

Unable to unrar file. Can you please recheck the file?
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

by the way, i thank you inf0byt3 for your demo.
i do not have time, these days, to work on it...
but i will need to discuss more about it, soon.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Np :). I think I accidentally deleted the file from PureStorage, but the link is fixed now.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Re: Plugin-Based Apps

Post by NoahPhense »

Very nice..

- np
quasiperfect
Enthusiast
Enthusiast
Posts: 157
Joined: Tue Feb 13, 2007 6:16 pm
Location: Romania
Contact:

link broken

Post by quasiperfect »

link broken can someone please share this code again

thanks
Registered user of PureBasic
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Post by Foz »

If someone can send me the rar, I'll post it on my website for a permanent location.

Hmmm... I really do need to put up a general storage place for things like this.

And I would like to have a look at it too, because I've rediscovered a project I started a year or two ago in .net that was based on plugins and I'd like to redo it properly in PB :)
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Post by NoahPhense »

quasiperfect
Enthusiast
Enthusiast
Posts: 157
Joined: Tue Feb 13, 2007 6:16 pm
Location: Romania
Contact:

thanks

Post by quasiperfect »

funy name for a domain but thanks for the files
Registered user of PureBasic
User avatar
NoahPhense
Addict
Addict
Posts: 1999
Joined: Thu Oct 16, 2003 8:30 pm
Location: North Florida

Re: thanks

Post by NoahPhense »

I have a few domains.. I got that one, cause people were always asking
me to burn them sh!t .. :)

- np
quasiperfect
Enthusiast
Enthusiast
Posts: 157
Joined: Tue Feb 13, 2007 6:16 pm
Location: Romania
Contact:

Post by quasiperfect »

anyone has any other example ?
or any other piece of info that can help

i want to make a plugin based app where
1. each plugin ads a menu or more in the main app menu
2. each plugin can open one or more windows with gadgets
basicly i don't want to close one plugin to be able to open another.

is this posible ?
any bare bone example ?

this example has some problems or i'm a idiot
i created another plugin same as 1

Code: Select all

ProcedureDLL.l ExitCallback()
  
  MessageRequester("Plugin3","It seems that the main app is quitiing ... I gotta do that too",32)
  
  ProcedureReturn
  
 EndProcedure
 
 ProcedureDLL.s WHO_ARE_YOU()
  
  ProcedureReturn "I_AM_YOUR_FATHER"
  
 EndProcedure
 
 ProcedureDLL.s GetPluginName()
 
  ProcedureReturn "Plugin3"
 
 EndProcedure
 
 ProcedureDLL.s GetPluginDesc()
 
  ProcedureReturn "Opens another window"
 
 EndProcedure
 
 ProcedureDLL.s GetPluginAuthor()
 
  ProcedureReturn "Inf0Byt3"
 
 EndProcedure
 
 ProcedureDLL.s PluginMain()

  If OpenWindow(666, 100, 200, 195, 260, "PureBasic Window", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)

   Repeat
     EventID = WaitWindowEvent()
     If EventID = #PB_Event_CloseWindow  ; If the user has pressed on the close button
       Quit = 1
     EndIf
   Until Quit = 1
   CloseWindow(666)
  EndIf
launch the 3 plugin and click on the list of plugins from the main window it crashes the app. i'm running latest beta of purebasic on win xp sp3
Registered user of PureBasic
localmotion34
Enthusiast
Enthusiast
Posts: 665
Joined: Fri Sep 12, 2003 10:40 pm
Location: Tallahassee, Florida

Post by localmotion34 »

RAR file is missing from all links...

I need an example of how to do this, thanks guys.

Code: Select all

!.WHILE status != dwPassedOut
! Invoke AllocateDrink, dwBeerAmount
!MOV Mug, Beer
!Invoke Drink, Mug, dwBeerAmount
!.endw
quasiperfect
Enthusiast
Enthusiast
Posts: 157
Joined: Tue Feb 13, 2007 6:16 pm
Location: Romania
Contact:

Post by quasiperfect »

Registered user of PureBasic
Post Reply