Article # 18, added by Geoworks, historical record
| first | previous | index | next | last |

Multi-launchable apps and GeodeGetOptrNS




Question:
I get this error in my program:

  ILLEGAL_HANDLE

and it seems to be associated with this line:

  @send MyPrimary::MSG_META_DO_STUFF( @MyObject );

Answer:
The problem is that with multiple source-file programs that are compiled 
is multi-launchable applications, you can't refer to objects in another
source file just by their name. You have to use the function
GeodeGetOptrNS to get a valid optr. Here is how to fix that line:

    optr primary;
    primary = GeodeGetOptrNS( @MyPrimary );
    @send primary::MSG_META_DO_STUFF( GeodeGetOptrNS( @MyObject ) );

You won't have to do this if you are compiling the program as a
single-launchable app. Also, you can't use GeodeGetOptrNS if the app is
single-launchable.