comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: object reference in a structure
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: object reference in a structure [message #12857 is a reply to message #12843] Thu, 17 September 1998 00:00 Go to previous messageGo to previous message
Vap User is currently offline  Vap User
Messages: 31
Registered: April 1998
Member
"Charlie Solomon" <crsolomon@west.raytheon.com> writes:

>
> Hi everyone...is it possible to put an object reference in a structure
> variable? For example, I create a new object, then create a pointer to an
> info structure for my widget and try to include the object reference in the
> structure:
>
> junk = 'charlie was here'
> ptr_new, info( { junk:junk, oWindow:0 } )
>

Imminently doable. The thing you must store in the structure is a null object
reference. You get one in a way analogous to how you get a null
pointer reference, i.e. with Obj_New(). Try...

Widget_Control, widget_id_where_you_want_to_store_this_info, $
set_UValue=Ptr_New( { junk:junk, oWindow: Obj_new() } )

Then everything else will work fine. I do this sort of thing all the time.


>
> But when I try to access it bad things happen (I can get the actual error
> message if needed). Here's how I try to access it:
>
> (*info).oWindow = obj_new('IDLgrWindow') ;no worky
> (*info).oWindow -> method, keywords ;no worky
>
> Should I even be trying this? I want to be able to store the object
> reference in info after it is created in another procedure and passed back
> so that my widget program can modify properties and destroy it based on
> xmanager events. Thanks!
>
>

--
I don't speak for JPL, it doesn't speak for me.
Well, not all the time, at least.
William Daffer <vapuser@haifung.jpl.nasa.gov>
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: test
Next Topic: Re: Setting ranges on surfaces

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 16:39:01 PDT 2025

Total time taken to generate the page: 0.00956 seconds