[futurebasic] Re: [FB] [FB^3] DCODs using functions in the calling application

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2000 : Group Archive : Group : All Groups

From: Joe Lewis Wilkins <PepeToo@...>
Date: Fri, 04 Feb 2000 16:36:53 -0800
OK guys and gals,

My turn to ask a stupid question. I'm entitled - I think!

With all of the discussion that has taken place with DCODs, why would you
necessarily want/need to use them. If they were really important, I would think
that Andy would have included them in FB^3, No? I understand that they may be
convenient for backward compatibility, but are they necessary for those of us
who have never used them and don't know why they're needed in the first place?

I told you this would be stupid, but my curiosity could take this  no more! This
is probably one time that I should go to the manuals and I'd learn something,
but maybe I would learn something I'd just as soon not know - like how to write
poetry or come up with [i]gnom[e][inious] sign-offs.

Joe Wilkins

Robert Purves wrote:

> >> Lastly, and to show my ignorance, steps 1 and 2 require a mode switch (PPC
> >> <-> 68K). Presumably in step 2 this is accomplished by courtesy of
> >> UNIVERSALFN. But how do you set up the mode switch in step 1? According to
> >> the Reference Manual, the  CALL <resource> statement can access either 68K
> >> or PPC code. How does it know which you've got in the DCOD?
> >
> >I call the DCODs using the UNIVERSALPROC command which takes care of the
> >mixed mode switch if the app is running in PPC mode.
>
> Ah, right, thanks, I think I have it now. It seems that the statement
>     CALL DCODName$, 0
> can only be used in 68K, although not marked as such in the Reference Manual.
>
> So you have to load in the DCOD manually, right? With something like
>
> hndl& = fn GetNamedResource(_"DCOD", DCODName$)
> long if hndl&
> call DetachResource(hndl&)
> call HLock(hndl&)
> dcodPtr& = [hndl&]
> end if
>
> Then you call it with
> returnVal = UNIVERSALFN(dcodPtr&,flags,param1,param2...)
>
> UNIVERSALFN is FB^3's wrapper for the code fragment manager routine
> CallUniversalProc, which does the clever stuff of working out that your
> DCOD code is 68K and doing the mode switch automatically.
>
> Understanding these matters is going to be even more important (and
> difficult) in the future when FB^3 can make resources containing PPC code
> fragments.
>
> Robert P.
>
> --
> To unsubscribe, send ANY message to <futurebasic-unsubscribe@...>