Problem with deriving Metrowerks Classes...

Problem with deriving Metrowerks Classes...

Post by Noah Mittm » Sun, 29 Oct 1995 04:00:00



   I've got a derived IconPane which I'm trying to get to handle Drag and
Drop.  In the header, I have:

static CDropIcon* CreateDropIconStream(LStream *inStream);

   In the source, I have:

CDropIcon*
CDropIcon::CreateDropIconStream(
   LStream  *inStream)
{
   return (new CDropIcon(inStream));

Quote:}

   The linker says:

Error   : function call '__ct(int, LStream *)' does not match
'__ct(CDropIcon *const , short)'
'__ct(CDropIcon *, short, const CDropIcon &)'
CDropIcon.cp line 17   return (new CDropIcon(inStream));

   Now I have another project which has a derived LWindow and uses the
exact same format as the above, but works.  But for this project, it's not
working.  Any ideas?

--
Noah Mittman                    |
Editor/Technical Director,      |   "You can't destroy me... I quit!!!"
Fire & Rain Productions, NYC    |                - Crow T. Robot, MST3K
<a href="http://www.panix.com/~nam/firerain/">

 
 
 

Problem with deriving Metrowerks Classes...

Post by Noah Mittm » Mon, 30 Oct 1995 03:00:00



: The link error seems to indicate that you haven't declared a constructor
: for your pane that takes an LStream* as an argument:

: In your class definition, add

:    CDropIcon(LStream * inStream);

: and in your source:

: CDropIcon::CDropIcon(LStream *inStream)
:         : LIconPane(inStream)  // or whatever the actual base class is
: {
:    // any additional initializations
: }

        That seems odd... My other project had a CVideoWindow which was
derived from LWindow, LListener, and LPeriodical and had the same default
format for Create___Stream (without the ctor) and it linked fine.  What
makes it different from this LPane derivation?
        And when can we expect a PowerPlant book that expands beyond the
Cookbook and Sydow's "MW Codewarrior Programming"?

        Oh, and thanks - to you and Eric S.  :)

--
Noah Mittman
Editor / Technical Director
Fire & Rain Productions, NYC
lost in TCSH land again cause Panix fumbled DNS

 
 
 

Problem with deriving Metrowerks Classes...

Post by Kevin Be » Mon, 30 Oct 1995 03:00:00




>    I've got a derived IconPane which I'm trying to get to handle Drag and
> Drop.  In the header, I have:

> static CDropIcon* CreateDropIconStream(LStream *inStream);

>    In the source, I have:

> CDropIcon*
> CDropIcon::CreateDropIconStream(
>    LStream  *inStream)
> {
>    return (new CDropIcon(inStream));
> }

>    The linker says:

> Error   : function call '__ct(int, LStream *)' does not match
> '__ct(CDropIcon *const , short)'
> '__ct(CDropIcon *, short, const CDropIcon &)'
> CDropIcon.cp line 17   return (new CDropIcon(inStream));

The link error seems to indicate that you haven't declared a constructor
for your pane that takes an LStream* as an argument:

In your class definition, add

   CDropIcon(LStream * inStream);

and in your source:

CDropIcon::CDropIcon(LStream *inStream)
        : LIconPane(inStream)  // or whatever the actual base class is
{
   // any additional initializations

Quote:}

Kevin Bell
Metrowerks
 
 
 

Problem with deriving Metrowerks Classes...

Post by Noah Mittm » Tue, 31 Oct 1995 04:00:00


        Ach.  Never mind that last message.  I overlooked that I was adding
another constructor in (and not just adding to the one I had) while cursing
out Panix and their modem screwups at the time I was reading it.
        I added it and it worked fine.  Again, thanks!

--
Noah Mittman
Editor / Technical Director
Fire & Rain Productions, NYC
lost in TCSH land again cause Panix dropped DNS