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

  • From: Jeff McClintock <jeffmcc@xxxxxxxxxx>
  • To: gmpi@xxxxxxxxxxxxx
  • Date: Tue, 08 Feb 2005 13:30:33 +1300

>>class IGMPI_Plugin
>>{
>>  virtual void placeholder1(void) = 0;
>>  virtual void placeholder2(void) = 0;
>>};

> Again, C first.  Also, why "IGMPI_Plugin"?  what does the leading "I"
> mean?  Is this some convention I just don't know?

Hi Tim,
Welcome to COM.

First, that *is* the C (in a sense)...

struct IGMPI_Plugin
{
  virtual void __stdcall placeholder1(void) = 0;
  virtual void __stdcall placeholder2(void) = 0;
};

That is *directly* equivalant to describing an 2 element array of plain-C function pointers. Bit mind-boggling yes. But with COM, you don't have to write any plain-C, yet that code is completly plain-C Compatible, once you know the equivalent plain-C signature...

// plain C version, two pointers-to-functions. easily derived from the C++ version
struct IGMPI_Plugin
{
void (*placeholder1)(IGMPI_Plugin *object_ptr);
void (*placeholder2)(IGMPI_Plugin *object_ptr);
}


I stands for "Interface", it's the sub-set of GMPI_Plugin that gets exported to the host.

here's the best explanation i've found so far, not great, but might help..

http://www.codeproject.com/com/COM_from_scratch_1.asp

Best Regards,
Jeff




---------------------------------------------------------------------- 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: