[futurebasic] Re: [FB] More pointers

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 1999 : Group Archive : Group : All Groups

From: Mel Patrick <mel@...>
Date: Thu, 8 Jul 1999 09:17:33 -0700
>Hello FB People,
>
>First, thanks to Chris and Rick, you both nailed that
>problem down for me.
>
>Now, continuing along in my saga, I have a function in Pascal
>that returns a ComponentInstance (which in Pascal is a pointer to
>a record containing an array of one long). The function is
>OpenDefaultComponent, and I have converted it to FB using the
>converter. In pascal the declaration is:
>
>FUNCTION OpenDefaultComponent(componentType: OSType; 
>componentSubType: OSType): ComponentInstance;
>
>I need to know:

Here's the openDefaultComponent routine :

CLEAR LOCAL MODE
LOCAL FN OpenDefaultComponent(compType&,compSub&)
   `     CLR.L   -(sp)                   ; make room for the result
   `     MOVE.L  ^compType&,-(sp)        ;PREF arguement
   `     MOVE.L  ^compSub&,-(sp)         ;ICAp for ICConfig component
   `     DC.W    $7021,$A82A             ;OpenDefaultComponent
   `     MOVE.L  (sp)+,^inst&            ;get the instance we can use
END FN = inst&

Here's how it's used :

     gInstance&=FN OpenDefaultComponent(_"PREF",_"ICAp"):'          try this
     LONG IF gInstance&=_False:'                  see if we have a component
       FN GNeedsWork("Application is designed to work best with 
Internet Config!")
     END IF

Hope this helps.


Mel Patrick
mel@...