Re: [Dev-C++] A Plugin Engine for my Application
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: hhh h. <the...@ho...> - 2007-12-12 16:05:26
|
Per Westermark,
I apologize, I did not review my last email before sending it.
Let me try to elaborate...
I see some co-relations of my concept with your second paragraph.
My main idea is to have a internal "plug-in" structure, based on two
Linked Lists...
One is a Message Queue, shared by all the "internal plug-ins".
/** @code : */
struct Message {
char bUrgentMessage;
long lToPlugin;/** @brief containing signature of the intended plugin
*/ void* vData; /** @brief Data of variable length and type */
struct* Message
}
struct Plugin {
long lPluginSignature; /** @brief Plugin Signature */
char sPlugin_Name[32];
int (*Plugin_Constructor )( void **vData );
int (*Plugin_Main )( void **vData );
int (*Plugin_Destructor )( void **vData );
}
/** @brief When we created a internal plugin, we would just create a
static object and assign our own made functions into those pointers,
then add a line into a function that does all the loading, creating
therefore a dynamically amount of internal plugins, by linking them all
together and in run time cycling through them delivering messages.
This method also provides me a way to message through my plugins...
*/
/** ! @code */
As the exterior plugins are concerned, I am thinking of using an internal
plugin to load exterior ones... and seek out always the same named functions
by GetProcAddress() by that is seeming a quite hazardous scheme as I am sure
to get in trouble if a malicious DLL gets loaded into process...
Could you advise me on that?
Maybe I could, as you state, run some of the plug ins in threads... That
would help me in processing information much faster, as this is designed to
be a Database Server with HTTP and other capabilities built in . But I am
not so sure about that shared memory statement. How can I share memory ? ...
I do not want to be a CPU hog ( :) )
I am sorry that I cannot give out any more code... I haven't any, as this
is mainly a theoretical design.
>From: Per Westermark <pw...@ia...>
>To: hhh hhh <the...@ho...>
>CC: sam...@gm...,
>Dev...@li...,dar...@gm...,
>ps...@el...
>Subject: Re: [Dev-C++] A Plugin Engine for my Application
>Date: Wed, 12 Dec 2007 15:31:17 +0100 (CET)
>
>Too little information given.
>
>You can load plugin modules as DLL files - one or more plugins/DLL.
>
>You will have a hard time protecting your program from ending if the
>plugin is badly written. Windows kills broken programs, not broken
>plugins. Maybe you can run the individual plugins as separate programs,
>but then you must check into shared memory, sockets etc for
>sending/receiving data between main program and plugin.
>
>You haven't written anything about how much data each plugin needs to do
>it's work. You haven't mentioned how long running time a plugin may
>require for a call. You haven't specified expected # of calls/time unit.
>You haven't discussed any requirements for concurrent operation of
>multiple plugins, or how long time a plugin may consume before returning
>(potentially with an answer).
>
>The paragraph "To be clear" is most definitely not clear. It almost sounds
>like you are talking about a driver layer either interfacing below the
>Win32 API, or between the Win32 API and the plugins. But too little
>details and no information about what problem you want to solve.
>
>/pwm
>
>On Wed, 12 Dec 2007, hhh hhh wrote:
>
> >
> > Hi. I am developing a application, where my developmental concept is a
> > hierarchical set of platform.
> >
> > I have a platform, at the very start of my tree-like app. This
>platform I
> > gave the name "plugin_engine".
> > Its basically two Linked Lists, one with function pointers (struct
> > Plugin), and the other with data structs(struct Message)...
> > The ideia is to itenerate through the Plugin Linked List, and
> > subsequentially through the Message Linked List.
> > If a Message ( read "a member of struct Message** LinkedList") is
> > designated to a defined Plugin ( read "a member of struct Plugin**
> > LinkedList ") we give the control to the plugin main function ( Remember
> > that struct Plugin has function pointer members. )
> >
> > The first conceptual challange I have is... How to integrate the Win32
>API
> > into that Plugin platform ?
> > To be clear, I wan't my platform at the very first start of the
>design
> > and not as a branch of Win32 Windowing API, so i can also have complete
> > control over files/socket operation, and users databases (Also to be
> > included)
> > I cannot have a critical error that forces my app to break... I wish
>to
> > maintain the most control possible.
> > The second is : How can I also create a dynamic plugin structure? Load
> > exterior plugins developed for my app?
> >
> > _________________________________________________________________
> > Transfira JÁ a última versão do Windows Live Messenger!
> > http://get.live.com/pt-pt/messenger/overview
> >
> >
> >
>-------------------------------------------------------------------------
> > SF.Net email is sponsored by:
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for
> > just about anything Open Source.
> > http://sourceforge.net/services/buy/index.php
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
> >
>
>
>-------------------------------------------------------------------------
>SF.Net email is sponsored by:
>Check out the new SourceForge.net Marketplace.
>It's the best place to buy or sell services for
>just about anything Open Source.
>http://sourceforge.net/services/buy/index.php
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
Transfira JÁ a última versão do Windows Live Messenger!
http://get.live.com/pt-pt/messenger/overview
|