On Mon, Feb 14, 2005 at 04:52:25PM +1300, Jeff McClintock wrote: > Note the first two steps are Windows-specific, perhaps a Linux person > could help out here. And that should be abstracted to platform specific functions, right? from platform.h: typedef struct GMPI_DllHandle { /* platform ifdefs */ } GMPI_DllHandle; /* implemented in platform.cpp or something */ GMPI_DllHandle *gmpi_DllLoad(const char *dll); void *gmpi_DllSymbol(GMPI_DllHandle *handle, const char *symbol); > /* STEP 2: Locate entrypoint */ > typedef GMPI_RESULT GMPI_STDCALL PLUGIN_FACTORY( const GMPI_GUID > *, GMPI_GUID *,void** ); typedefs don't belong in mainline code. This should go into gmpi_com.h or something. Also the syntax is weird to me, as a C programmer. Is this supposed to be C++ or C? It's a .cpp, so I assume C++. Is this the same meaning as the more familiar (to me) C code below? /* typedef a function pointer 'new_type' */ typedef GMPI_RESULT (*new_type)(const GMPI_GUID*, GMPI_GUID*, void**); I am assuming it's the same. If so, a few questions. Where did this signature come from and what are the arguments? Can we find a better name than "PLUGIN_FACTORY" ? How about GMPI_DllEntry or something? Since we're going to need a suite of GMPI_Dll* stuff anyway. > PLUGIN_FACTORY *make_factory = (PLUGIN_FACTORY*) > GetProcAddress(hinstLib, "DllGetClassObject"); "DllGetClassObject" is a long winded name. How about just GMPI_Factory or something short. > GMPI_RESULT r = (make_factory)( &IID_GMPI_IClassFactory, (GMPI_GUID > *) &IID_GMPI_IClassFactory, (void**) &factory ); Can you explain this? Also, no need to cast any of these pointers. It just makes the code fugly. > // instantiate plugin > r = (factory->Vtable->CreateInstance)(factory, (GMPI_GUID *) > &IID_GMPI_Prototype_DSP, (void**) &my_plugin); Ditto about casting ---------------------------------------------------------------------- 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