static ComponentResult CallBIMFunctionWithStorage( Handle inStorage,
                                                   ComponentParameters *inParams,
                                                   ProcPtr inProcPtr, SInt32 inProcInfo )
{
    ComponentResult		result;
    ComponentFunctionUPP	componentFunctionUPP;

    result = noErr;
    componentFunctionUPP = NewComponentFunctionUPP( inProcPtr, inProcInfo );
    result = CallComponentFunctionWithStorage( inStorage, inParams, componentFunctionUPP );
    DisposeComponentFunctionUPP( componentFunctionUPP );
    return result;
}
	PASCAL_RTN ComponentResult COMPONENT_DISPATCH_ENTRY( ComponentParameters *params, COMPONENT_GLOBALS() )
		{
		ComponentFunctionUPP theProc;
		
		ComponentResult result = badComponentSelector;
		theProc = COMPONENTSELECTORLOOKUP(params->what);

		if (theProc) {
			if ( (theProc != kCOMPONENT_ERROR) && (theProc != kCOMPONENT_NOERROR) ) {
				result = CallComponentFunctionWithStorage((Handle) storage, params, theProc);
			}
			else if ( theProc == kCOMPONENT_NOERROR ) {
				result = noErr;
			}
		}
	#ifdef GET_DELEGATE_COMPONENT
		else
			result = DelegateComponentCall(params, GET_DELEGATE_COMPONENT());
	#endif
		return result;
		}