Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I get an Mac OS Component Manager Component to be visible to other processes?
    primarykey
    data
    text
    <p>This is a bit esoteric, but there have to be a few people here who know how OS X's Carbon Component Manager works. I've made a couple of little apps to play around with making Components (see <a href="http://developer.apple.com/mac/library/DOCUMENTATION/Carbon/Reference/Component_Manager/Reference/reference.html" rel="nofollow noreferrer">here</a> for some background). Actually, one of the apps is a sample program straight from Apple called 'Fiendishthngs'. It lists all the Components that the Component Manager is making available. My program is a simple little thing that registers a Component, lists all the Components that the Component Manager has, and then waits around indefinately (to avoid purging the Component that it registered).</p> <p>On my system, the Component Manager is tracking 873 Components (mostly codecs of one sort of another). My program that registers a Component registers it, and then counts 874 Components because it just registered one itself, of course). Here's the source:</p> <pre><code>void RegisterBasicComponent() { ComponentDescription desc; desc.componentType = kMyComponentType; desc.componentSubType = kMyComponentSubType; desc.componentManufacturer = kMyComponentManufacturer; desc.componentFlags = 0; desc.componentFlagsMask = cmpIsMissing; ComponentRoutineUPP MyComponentRoutineUPP = NewComponentRoutineUPP( &amp;MyComponentRoutineProc ); // Handle name_handle = NewHandle( sizeof( kMyComponentName ) ); //strcpy( *(char**)name_handle, kMyComponentName ); //RegisterComponent( &amp;desc, MyComponentRoutineUPP, registerComponentGlobal, name_handle, NULL, NULL ); Component component = RegisterComponent( &amp;desc, MyComponentRoutineUPP, registerComponentGlobal, NULL, NULL, NULL ); if ( NULL != component ) printf("The registration seems to have worked!\n"); else printf("Nope - didn't work for some reason.\n"); } int main( void ) { RegisterBasicComponent(); ComponentDescription looking; // OSType componentType; /* A unique 4-byte code indentifying the command set */ // OSType componentSubType; /* Particular flavor of this instance */ // OSType componentManufacturer; /* Vendor indentification */ // UInt32 componentFlags; /* 8 each for Component,Type,SubType,Manuf/revision */ // UInt32 componentFlagsMask; /* Mask for specifying which flags to consider in search, zero during registration */ looking.componentType = kAnyComponentType; looking.componentSubType = kAnyComponentSubType; // looking.componentSubType = kComponentResourceType looking.componentManufacturer = kAnyComponentManufacturer; looking.componentFlags = 0; looking.componentFlagsMask = cmpIsMissing; long numComponents = CountComponents ( &amp;looking ); printf("Found %ld components.\n", numComponents); Component component = 0; int i = 0; while (true) { component = FindNextComponent(component, &amp;looking); if ( 0 == component ) break; ComponentDescription desc; Handle componentName = NewHandle(256); Handle componentInfo = NewHandle(1024); Handle componentIcon = 0; OSErr err = GetComponentInfo( component, &amp;desc, componentName, componentInfo, componentIcon ); if ( err != noErr ) { printf("Couldn't find any info on component %d of %ld in list!\n", i , numComponents); break; } printf( "%d of %ld: '%c%c%c%c', '%c%c%c%c', '%c%c%c%c', '%s'\n", i, numComponents, SPLAT_WORD( desc.componentManufacturer ), SPLAT_WORD( desc.componentType ), SPLAT_WORD( desc.componentSubType ), *componentName ); RecoverHandle( *componentName ); RecoverHandle( *componentInfo ); ++i; } while (true) { printf("Waiting around for someone to use me...\n"); sleep( 3 ); } } </code></pre> <p>Anyways, when I run this, keep it running (so the Component would presumably stay registered with the Component Manager), and then run Fiendishthngs, Fiendishthngs can't see my test Component that I register - it only sees 873 Components. The 'registerComponentGlobal' flag passed into RegisterComponent() is supposed to make the Component available to other processes, but it seems like something is going awry.</p> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload