<DIV>hi,didn't understand my question.</DIV>
<DIV>i want to say.</DIV>
<DIV>i write the code like follow in vc6:</DIV>
<DIV><includetail>
<DIV>class MyRTSPServer : public RTSPServer {public:<BR> MyRTSPServer();<BR> class MyRTSPClientSession : public RTSPClientSession {<BR> public:<BR> MyRTSPClientSession();<BR><BR> // redefined virtual function:<BR> virtual RTSPClientSession* createNewClientSession(unsigned <BR>sessionId, int clientSocket, struct sockaddr_in clientAddr);<BR> };<BR>};</DIV>
<DIV>but the compile error comes out.and say </DIV>
<DIV>D:\develop\develop\InterfaceRTSPServer\src\DynamicRTSPServer.h(69) : error C2504: 'RTSPClientSession' : base class undefined</DIV>
<DIV>i am sure i include the #include "RTSPServer.hh"</DIV>
<DIV> </DIV>
<DIV>------------------ Original ------------------</DIV>
<DIV style="COLOR: #000">
<DIV style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px">
<DIV id=menu_sender><B>From: </B> "Ross Finlayson"<finlayson@live555.com>;</DIV>
<DIV><B>Date: </B> Tue, Nov 16, 2010 10:38 AM</DIV>
<DIV><B>To: </B> "LIVE555 Streaming Media - development & use"<live-devel@ns.live555.com>; <WBR></DIV>
<DIV></DIV>
<DIV><B>Subject: </B> Re: [Live-devel] inherit from RTSPClientSession</DIV></DIV>
<DIV> </DIV>>this is your RTSPClientSession definition<BR>><BR>>class RTSPServer: public Medium {<BR>>protected:<BR>> class RTSPClientSession {<BR>>};<BR>>};<BR>><BR>>and how can i inherit a subclass from RTSPClientSession in vc6.<BR>><BR>>class MyRTSPServer : public RTSPServer<BR>>{<BR>>public:<BR>>class MyRTSPClientSession : public RTSPClientSession<BR>>{<BR>>};<BR>>};<BR><BR>Because both "RTSPServer" and "RTSPClientSession" have (non-default) <BR>constructors, you also have to define constructors for their <BR>subclasses. The following is legal C++:<BR><BR>class MyRTSPServer : public RTSPServer {public:<BR> MyRTSPServer();<BR> class MyRTSPClientSession : public RTSPClientSession {<BR> public:<BR> MyRTSPClientSession();<BR><BR> // redefined virtual function:<BR> virtual RTSPClientSession* createNewClientSession(unsigned <BR>sessionId, int clientSocket, struct sockaddr_in clientAddr);<BR> };<BR>};<BR><BR>Of course, you will presumably want to add parameters to the <BR>"MyRTSPServer" and "MyRTSPClientSession" constructors.<BR><BR>Note that you'll need to redefine the virtual function <BR>"createNewClientSession()" in your "MyRTSPClientSession" subclass (as <BR>noted in the code above), and have your (re)implementation of this <BR>virtual function return an object of type "MyRTSPClientSession".<BR><BR>Also, because "MyRTSPServer" objects (just like "RTSPServer" objects) <BR>should always be allocated on the heap (rather than on the stack), <BR>you might also want to make the "MyRTSPServer" constructor <BR>"protected:", and define a static "createNew()" function for creating <BR>these objects. (This is optional, however; instead, your application <BR>code could just do "new myRTSPServer";)<BR>-- <BR><BR>Ross Finlayson<BR>Live Networks, Inc.<BR>http://www.live555.com/<BR>_______________________________________________<BR>live-devel mailing list<BR>live-devel@lists.live555.com<BR>http://lists.live555.com/mailman/listinfo/live-devel<BR></DIV></includetail></DIV>