[gmpi] Re: low level API - Abstract Factory summary

  • From: "Angus F. Hewlett" <angus@xxxxxxxxxxxxx>
  • To: gmpi@xxxxxxxxxxxxx
  • Date: Tue, 08 Feb 2005 10:38:38 +0000

You don't have to do it this way... MS compilers allow a .DEF module definition file to be included in the project, anything in the DEF will be exported. There's only one entry point, so the DEF is a single line.

However, you do have to specify C-style naming and linkage in the function definition... it resolves down to:-
extern "C" IUnknown *GetPluginFactory();


My own preference would be to set up a GMPI_EXPORT macro which can then be defined on a platform-dependent basis.

Best regards,

      Angus.




Tim Hockin wrote:

On Tue, Feb 08, 2005 at 02:53:21PM +1300, Jeff McClintock wrote:


So no special keyword like on windows?, I've now get something like this...

extern "C" {

EXPORT_THIS_SYMBOL

IUnknown* GetPluginFactory(void)
{
// snip
}



So that seems to be how it has to be done. Yuck. Does __declspec() apply to the next symbol declared, or is it some global flag? If it applies to the next symbol, I'd rather see a tighter binding:

EXPORT_THIS_SYMBOL IUnknown *GetPluginFactory()

or

EXPORT_THIS_SYMBOL IUnknown *
GetPluginFactory()

or

EXPORT_THIS_SYMBOL
IUnknown *GetPluginFactory()

or

EXPORT_THIS_SYMBOL
IUnknown *
GetPluginFactory()



..as to the factory being an object, or just a function. I'm not worried either way.



I think making it an object is just OO masturbation. It feels good, but
it doesn't really achieve anything.


Invoking the dll entry point is querying for metadata.  It discovers the
list of plugins in that package.  Then you can go out and read the
associated metadata file (I feel dirty just saying that) and/or query the
plugin further for more metadata.

As for external metadata, I'll survive with it, but we STILL need to
provide internal metadata, too, for things like wrappers.

Lastly, what the heck is an IUnknown in C?  Where's some definition for
that?

----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: //www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe







--
=========================================================
Angus F. Hewlett, Managing Director (CEO)
FXpansion Audio UK Ltd - http://www.fxpansion.com
Registered in the UK - #4455834 - VAT: GB 798 7782 33
=========================================================



---------------------------------------------------------------------- Generalized Music Plugin Interface (GMPI) public discussion list Participation in this list is contingent upon your abiding by the following rules: Please stay on topic. You are responsible for your own words. Please respect your fellow subscribers. Please do not redistribute anyone else's words without their permission.

Archive: //www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: