<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
<p><small><font face="Comic Sans MS">I am having a problem in wrapping
a protected enum declared in a child class. For some reason, the sip
code below is converting Element::OptionalCRLF parameters to int, which
results in a compiler error. If anyone has an idea of what is wrong in
my wrapped code, please let me know.<br>
</font></small></p>
<tt>sippyptlibPHTMLFormField.cpp<br>
.\sippyptlibPHTMLFormField.cpp(53) : error C2664:
'PHTML::FormField::FormField(const char *,const char
*,PHTML::ElementInSet,<br>
PHTML::Element::OptionalCRLF,PHTML::DisableCodes,const char *)' :
cannot convert parameter 4 from 'int' to 'PHTML::Element::OptionalCRLF'<br>
Conversion to enumeration type requires an explicit cast
(static_cast, C-style cast or function-style cast)<br>
<br>
class PHTML<br>
{<br>
public:<br>
enum ElementInSet {<br>
InHTML,<br>
NumElementsInSet<br>
};<br>
<br>
enum DisableCodes {<br>
Enabled,<br>
Disabled<br>
};<br>
<br>
PHTML(<br>
const char * cstr ///< C string representation of the
title string.<br>
);<br>
<br>
class Element {<br>
public: <br>
virtual ~Element();<br>
protected:<br>
enum OptionalCRLF { NoCRLF, OpenCRLF, CloseCRLF, BothCRLF };<br>
Element(<br>
const char * nam,<br>
const char * att,<br>
PHTML::ElementInSet elmt,<br>
PHTML::ElementInSet req,<br>
OptionalCRLF opt<br>
);<br>
virtual void Output(PHTML & html) const;<br>
virtual void AddAttr(PHTML & html) const;<br>
};<br>
<br>
class FieldElement : PHTML::Element {<br>
protected:<br>
FieldElement(<br>
const char * nam,<br>
const char * attr,<br>
PHTML::ElementInSet elmt,<br>
OptionalCRLF opt,<br>
PHTML::DisableCodes disabled<br>
);<br>
virtual ~FieldElement();<br>
virtual void AddAttr(PHTML & html) const;<br>
};<br>
};</tt><br>
<br>
<tt>Offending C++ Code - as you can see 'int a3' should actually be
PHTML::Element::OptionalCRLF. I am not sure why sip is treating this as
an int.<br>
<br>
sipPHTML_FormField::sipPHTML_FormField(const char *a0,const char
*a1,PHTML::ElementInSet a2,<u><b>int a3</b></u>,PHTML::DisableCodes
a4,const char *a5): PHTML::FormField(a0,a1,a2,a3,a4,a5), sipPySelf(0)<br>
{<br>
memset(sipPyMethods, 0, sizeof (sipPyMethods));<br>
}</tt><br>
<br>
</body>
</html>