[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie Questions

Geoff Herbynchuk wrote:

> On Tue, 15 May 2001, Geoff Herbynchuk wrote:
> > Was just wondering if IDL can have pointers to structures.  I'm trying to
> > access a variable in the structure with:
> >
> >       if (*info).active_cursor EQ 1) then .....
> >
> > And I keep getting an error which says "Expression must be a structure in
> > this context: <PtrHeapVar57>."
> >


If the active_cursor tag represents the pointer within the structure, then you
will want to dereference it as follows:

    if *(info.active_cursor) EQ 1 then .....

As JD has pointed out to the us pointer-challenged, you can also go the lazy

    if *info.active_cursor EQ 1 then .....

The way you have written (*info).active_cursor indicates that info is a pointer
to a structre that conatins the active_cursor rather than being a structure
containing a field defined as pointer.


Ben Tupper
248 Lower Round Pond Road
POB 106
Bristol, ME 04539

Tel: (207) 563-1048
Email: PemaquidRiver@tidewater.net