Re: Any problems expected in Multiple inheritance with template class ?
This is a multi-part message in MIME format.
------=_NextPart_000_016C_01C8E2EA.024AF2B0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sorry for the incomplete mail:
I have my derived class
CABIOleDbSet : public CCommand<TAccessor, TRowset>, public CABISet
{
....
}
In CABISet I have a function like this
class CABISet
{
..........
virtual void Open(const string& strSQL) = 0;
}
HRESULT CABIOleDbSet::OpenWithException(CABIOleDbSession& session, const =
string& strCmd, DBPROPSET *pPropSet)
{
if(session.IsOpen()==false)
{
ostringstream ost;
ost << "Session is not opened. Can'nt execute command [" << strCmd << =
"]";
throw CMyException(CONNECTION_ERROR, ost.str(), __FILE__, __LINE__);
}
wstring wstrCmd = StrToWstr(strCmd);
HRESULT hr = S_FALSE;
try
{
hr =CCommand::Open(*m_pSession, wstrCmd.c_str(), pPropSet);//CRASHES =
here
}
catch(...)
{
ASSERT(false);
}
return hr;
}
Any idea why?
Thanks and Regards
Ganga
"Igor Tandetnik" <itandetnik@mvps.org> wrote in message =
news:O6FGn0q4IHA.3484@TK2MSFTNGP05.phx.gbl...
"Ganga Sridhar" <gangasridhar@abosoftware.com> wrote in message
news:egVe9lp4IHA.5060@TK2MSFTNGP02.phx.gbl
When I use multiple inheritance i.e derived class CABIOleDBSet from
CCommand and CTest program crashes.
Crashes when doing what? I seem to have misplaced by crysal ball.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to =
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
------=_NextPart_000_016C_01C8E2EA.024AF2B0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; =
charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16674" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV>
<P><FONT face=Arial size=2>Sorry for the incomplete mail:</FONT></P>
<P><FONT face=Arial size=2>I have my derived class<FONT size=3>
</FONT></FONT></P>
<P><FONT face=Arial><FONT size=2><STRONG>CABIOleDbSet : public
CCommand<TAccessor, TRowset>, public
CABISet<BR></STRONG><BR>{<BR>...<BR>}<BR></FONT></P></FONT>
<P><FONT face=Arial size=2>In CABISet I have a function like this
</FONT></P><FONT face=Arial size=2><FONT color=#0000ff size=2>
<P>class</FONT><FONT size=2> CABISet </FONT></P>
<P><FONT size=2>{</FONT></P>
<P><FONT size=2>.........</P></FONT><FONT color=#0000ff size=2>
<P><STRONG>virtual</STRONG></FONT><STRONG><FONT size=2> </FONT><FONT
color=#0000ff size=2>void</FONT><FONT size=2> Open(</FONT><FONT =
color=#0000ff
size=2>const</FONT><FONT size=2> string& strSQL) = =
0;</FONT></STRONG></P>
<P><FONT size=2>}</P></FONT></FONT>
<P><FONT face=Arial size=2><STRONG>HRESULT
CABIOleDbSet::OpenWithException(CABIOleDbSession& session, const =
string&
strCmd, DBPROPSET *pPropSet)</STRONG></FONT></P>
<P><FONT face=Arial size=2>{</FONT></P>
<P><FONT face=Arial =
size=2>if(session.IsOpen()==false)</FONT></P>
<P><FONT face=Arial size=2>{</FONT></P>
<P><FONT face=Arial size=2>ostringstream ost; </FONT></P>
<P><FONT face=Arial size=2>ost << "Session is not opened. =
Can'nt execute
command [" << strCmd << "]";</FONT></P>
<P><FONT face=Arial size=2>throw CMyException(CONNECTION_ERROR, =
ost.str(),
__FILE__, __LINE__);</FONT></P>
<P><FONT face=Arial size=2>}</FONT></P>
<P><FONT face=Arial size=2>wstring wstrCmd = =
StrToWstr(strCmd);</FONT></P>
<P><FONT face=Arial size=2>HRESULT hr = S_FALSE;</FONT></P>
<P><FONT face=Arial size=2></FONT></P>
<P><FONT face=Arial size=2>try</FONT></P>
<P><FONT face=Arial size=2>{</FONT></P>
<P><FONT face=Arial size=2><STRONG>hr =CCommand::Open(*m_pSession, =
wstrCmd.c_str(), pPropSet);//CRASHES here</STRONG></FONT></P>
<P><FONT face=Arial size=2>}</FONT></P>
<P><FONT face=Arial size=2>catch(...)</FONT></P>
<P><FONT face=Arial size=2>{</FONT></P>
<P><FONT face=Arial size=2>ASSERT(false);</FONT></P>
<P><FONT face=Arial size=2>}</FONT></P>
<P><FONT face=Arial size=2>return hr;</FONT></P>
<P><FONT face=Arial size=2>}</FONT></P>
<P><FONT face=Arial size=2>Any idea why?</FONT></P>
<P><FONT face=Arial size=2>Thanks and Regards</FONT></P>
<P><FONT face=Arial size=2>Ganga</FONT></P></DIV>
<DIV><FONT face=Arial size=2>"Igor Tandetnik" <</FONT><A
href="mailto:itandetnik@mvps.org"><FONT face=Arial
size=2>itandetnik@mvps.org</FONT></A><FONT face=Arial size=2>> =
wrote in
message </FONT><A =
href="news:O6FGn0q4IHA.3484@TK2MSFTNGP05.phx.gbl"><FONT
face=Arial =
size=2>news:O6FGn0q4IHA.3484@TK2MSFTNGP05.phx.gbl</FONT></A><FONT
face=Arial size=2>...</FONT></DIV><FONT face=Arial size=2>> =
"Ganga Sridhar"
<</FONT><A href="mailto:gangasridhar@abosoftware.com"><FONT =
face=Arial
size=2>gangasridhar@abosoftware.com</FONT></A><FONT face=Arial =
size=2>> wrote
in message<BR>> </FONT><A
href="news:egVe9lp4IHA.5060@TK2MSFTNGP02.phx.gbl"><FONT face=Arial
size=2>news:egVe9lp4IHA.5060@TK2MSFTNGP02.phx.gbl</FONT></A><BR><FONT =
face=Arial
size=2>>> When I use multiple inheritance i.e derived class =
CABIOleDBSet
from<BR>>> CCommand and CTest program crashes.<BR>> <BR>> =
Crashes
when doing what? I seem to have misplaced by crysal ball.<BR>> -- =
<BR>>
With best wishes,<BR>> Igor Tandetnik<BR>> =
<BR>> With
sufficient thrust, pigs fly just fine. However, this is not <BR>> =
necessarily
a good idea. It is hard to be sure where they are going to <BR>> =
land, and it
could be dangerous sitting under them as they fly <BR>> overhead. -- =
RFC 1925
<BR>> <BR>></FONT></BODY></HTML>
------=_NextPart_000_016C_01C8E2EA.024AF2B0--