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

I get an ILLEGAL_HANDLE error when referring to objects.



Q. 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 );

   This code is in the primary.goc file and "MyObject" is defined in
   appUI.goc file.

A. The problem is with multi-source files 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'll also have to make the program multi-launchable. Take out
   the "single" in the type line of your .GP file.