[comp.windows.ms.programmer] Pointer to Functions in Windows 3.0

mvishnu@csg.waterloo.edu (Meenan Vishnu) (12/19/90)

I have difficulty in using pointers to functions in Windows 3.0.

The pointer points to some invalid location after a while, even though
its value has not changed.  I tried making the code segments FIXED and
declaring all pointers to functions as FAR pointers:

RET_VAL_TYPE (FAR *FUNC_POINTER) ( PARM_1_TYPE, PARM_2_TYPE );

but I still keep getting "IRRECOVERABLE APPLICATION ERROR".  When I
used the CVW and steped through each line,  I find that the location
pointed by the pointer did not have any program code.

Has any netter faced this or similar problem and found any way of 
successfully using a pointers to funtions.  If so please send me
an e-mail note: (mvishnu@csg.uwaterloo.ca)

Thank You,

Vishnu 

risto@tuura.UUCP (Risto Lankinen) (12/27/90)

mvishnu@csg.waterloo.edu (Meenan Vishnu) writes:

>I have difficulty in using pointers to functions in Windows 3.0.

>The pointer points to some invalid location after a while, even though
>its value has not changed.  I tried making the code segments FIXED and
>declaring all pointers to functions as FAR pointers:

>RET_VAL_TYPE (FAR *FUNC_POINTER) ( PARM_1_TYPE, PARM_2_TYPE );

Hi!

I'd declare the function EXPORTed in the program's linker definition file,
and subsequently use the MakeProcInstance()'d address as the value of the
pointer variable.

Terveisin: Risto Lankinen
-- 
Risto Lankinen / product specialist ***************************************
Nokia Data Systems, Technology Dept *  2                              2   *
THIS SPACE INTENTIONALLY LEFT BLANK * 2 -1 is PRIME!  Now working on 2 +1 *
replies: risto@yj.data.nokia.fi     ***************************************