more detail about pfMalloc & object container

New Message Reply Date view Thread view Subject view Author view

David Chan (dchan++at++zeus.lnk.com)
Tue, 28 Apr 1998 12:33:33 -0400 (EDT)


HI,
        As the problem describe in my first mail, I want to add more
detail describtion:
        the abstract class "Console" is derived from "pfObject".
        Since "Console" is abstract class, so it can't be like this:
         
        typedef structure {
                ...
                Console console[10];
                ...
        } SharedData;
         

        And also I try to print out the address of shared->console[0], it
is 0, and it seems I can't assign the address of new object into the
array. I do it like this:

        typedef structure {
                ...
                Console *console[10];
                ...
        } SharedData;

        SharedData *shared = (SharedData *)pfMalloc(sizeof(SharedData),
pfGetSharedArena());
        shared->console[0] = new Dervid_class_from_Console(parm1,parm2);

        Then there is segnmentation fault when I try to access object
inside the array.
        And I can't use "CC" to link object program, because one of my
program is c program, the others are c++ program with C performer API.

Thanks in advance.
David Chan

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:18 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.