dev-cpp-users Mailing List for Dev-C++
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
(11) |
2
(17) |
3
(7) |
4
(12) |
|
5
(4) |
6
(11) |
7
(9) |
8
(5) |
9
(7) |
10
(2) |
11
(5) |
|
12
(1) |
13
(6) |
14
(1) |
15
(11) |
16
(4) |
17
(9) |
18
(6) |
|
19
(1) |
20
|
21
(14) |
22
(1) |
23
(6) |
24
|
25
|
|
26
|
27
(2) |
28
(1) |
29
(6) |
30
(9) |
31
(1) |
|
|
From: Per W. <pw...@ia...> - 2004-12-15 21:57:08
|
One more thing. If g_pIrcServerDataBase->currentNetwork() returns NULL,
you will never assign any value to your m_pSrv member within the
beConsole() constructor.
/Per W
On Wed, 15 Dec 2004, Black Eagle wrote:
> Hi guys!
>
> I got a problem at run time, when using a pointer in a function.
>
> The error is in the function KviIrcServer* server() at line : return m_pSrv;
>
> In all other functions I got no problem with this variable. It is another
> class that tries to call this function, it's the friendclass beChannel
>
>
> Here is the beConsole.h
>
> #ifndef BE_CONSOLE_H
> #define BE_CONSOLE_H
>
> #include "beMDIWindow.h"
>
> class KviIrcServer;
>
> class beConsole : beMDIWindow
> {
> friend class beIRC;
> friend class beChannel;
> Q_OBJECT
> public :
> beConsole(QWidget * parent = 0, const char * name = 0, WFlags f = 0);
> ~beConsole();
>
> KviIrcServer* server();
> protected :
> bool connectToServer();
> private slots :
>
> virtual void hostFound();
> virtual void connected();
> virtual void socketReadyRead();
> virtual void disconnected();
> void send(const QString & command);
> private :
> KviIrcServer * m_pSrv;
> // KviProxy * prx;
>
> QSocket * m_pQSocket;
> };
>
> #endif
>
> And here is the beConsole.cpp
> // beIRC stuff
> #include "beConsole.h"
> // kvirc stuff
> #define HAVE_CONFIG_H
> #include "config.h"
> #include <kvirc/3.0.1/kvi_app.h>
> #include <kvirc/3.0.1/kvi_ircserverdb.h>
> #include <kvirc/3.0.1/kvi_confignames.h>
> // QT Stuff
> #include <qregexp.h>
> #include <qsocket.h>
>
> extern KVIRC_API KviIrcServerDataBase * g_pIrcServerDataBase;
>
> beConsole::beConsole(QWidget * parent,const char * name, WFlags f) :
> beMDIWindow(parent,name,f)
> {
> m_windowType = beMDIWindow::Console;
>
> KviIrcNetwork * net = g_pIrcServerDataBase->currentNetwork();
>
> if(net)m_pSrv = net->currentServer();
> QString srvname = m_pSrv->hostname();
> setCaption(srvname);
> connect ( this, SIGNAL( userInput(const QString &) ), this, SLOT ( send(const
> QString &) ) );
> }
>
> beConsole::~beConsole()
> {
> delete m_pSrv;
> }
>
> bool beConsole::connectToServer()
> {
> if(!m_pSrv) { return false; }
> // QString text = "Connect to server";
> // m_pLineView->addLine(text);
> // \n for new liens
> // \t for tabs
> append("<mytag>Connecting to server...</mytag>");
>
> m_pQSocket = new QSocket(this);
> connect( m_pQSocket, SIGNAL( hostFound() ), this, SLOT( hostFound() ) );
> connect( m_pQSocket, SIGNAL( connected() ), this, SLOT( connected() ) );
> connect( m_pQSocket, SIGNAL( readyRead() ), this, SLOT(socketReadyRead()) );
> connect( m_pQSocket, SIGNAL( connectionClosed() ), this,
> SLOT( disconnected() ));
> m_pQSocket->connectToHost( m_pSrv->hostname(), m_pSrv->port() );
> return true;
> }
>
>
> void beConsole::hostFound()
> {
> append("<mytag>Host found ...</mytag>");
> }
>
> void beConsole::connected()
> {
> append("<mytag>Connected to "+m_pSrv->hostname()+"</mytag>");
> QString cmd;
> cmd = "USER alex 0 "+m_pSrv->hostname()+" :Using beIRC 0.0.1\n";
> m_pQSocket->writeBlock( cmd.latin1(), cmd.length() );
> cmd = "NICK blackeagle654\n";
> m_pQSocket->writeBlock( cmd.latin1(), cmd.length() );
> }
>
> void beConsole::socketReadyRead()
> {
> // append("<mytag>Socket is ready to read</mytag>");
> while ( m_pQSocket->canReadLine() ) {
>
> QString msg = m_pQSocket->readLine();
> QRegExp rxA("(.*)\n$");
> rxA.search( msg );
> append( rxA.cap(1) );
> /* BEGIN ping pong fast reply */
> QRegExp rx("^PING :([0-9]+)");
> int pos;
> if( (pos = rx.search(msg)) != -1)
> {
> QString cmd = "PONG :"+rx.cap(1)+"\n";
> m_pQSocket->writeBlock( cmd.latin1(), cmd.length() );
> }
> /* END ping pong fast reply */
> QRegExp rx2("376.*End of /MOTD command");
> if( (pos = rx2.search(msg)) != -1)
> {
> QString cmd = "JOIN #gentoo\n";
> m_pQSocket->writeBlock( cmd.latin1(), cmd.length() );
> }
> }
> }
>
> void beConsole::disconnected()
> {
> append("<mytag>Disconnected from server</mytag>");
> }
>
> void beConsole::send(const QString & command)
> {
> append("<command>"+command+"</command>");
> // command.append("\n");
> QString tmp = command+"\n";
> m_pQSocket->writeBlock( tmp.latin1(), tmp.length() );
> }
>
> KviIrcServer* beConsole::server()
> {
> qDebug("returning server");
> return m_pSrv;
> }
>
>
> Thanks for any help !
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Per W. <pw...@ia...> - 2004-12-15 21:55:34
|
Wait a minute.
m_pSrv is a pointer pointing to an object.
KviIrcServer* beConsole::server()
should return a pointer, i.e. the contents of m_pSrv, i.e.
return m_pSrv;
and not a copy of an object as is done by
return *m_pSrv;
When a function returns a pointer, this of course doesn't mean that it
returns the address of the pointer, but the value stored in the pointer,
i.e. the address of an object.
/Per W
On Wed, 15 Dec 2004, Black Eagle wrote:
> It's tricky but I think I got it
>
> In fact I am returning a pointer to m_pSrv which is a pointer itself, rat=
her
> than the adress of the class, right ?
>
> What could have worked is if m_pSrv was the class and that I returned &m_=
pSrv,
> the adress of the class.
>
> But I've done like this :
> KviIrcServer beConsole::server()
> {
> =09qDebug("returning server");
> =09return *m_pSrv;
> }
>
> Thanks for help !
>
> Le mercredi 15 D=E9cembre 2004 22:06, Alfred P. Reaud a =E9crit :
> > Hi Black Eagle,
> >
> > It could be that you are returning the address of m_pSrv rather than it=
's
> > contents. You've declared m_pSrv as a pointer to a KviIrcServer class.
> > However, in server(), you return m_pSrv, rather than it's contents *m_p=
Srv.
> > server() is declared as returning a pointer to the class, which is the
> > value of m_pSrv, not it's address.
> >
> > Hope that makes sense!
> >
> > Black Eagle <bla...@ea...> wrote:
> >
> > Hi guys!
> >
> > I got a problem at run time, when using a pointer in a function.
> >
> > The error is in the function KviIrcServer* server() at line : return
> > m_pSrv;
> >
> > In all other functions I got no problem with this variable. It is anoth=
er
> > class that tries to call this function, it's the friendclass beChannel
> >
> >
> > <snip>
> > class KviIrcServer;
> > <snip>
> > KviIrcServer* server();
> > <snip>
> > private :
> > KviIrcServer * m_pSrv;
> > <snip>
> > KviIrcServer* beConsole::server()
> > {
> > qDebug("returning server");
> > return m_pSrv;
> > }
> > <snip>
> >
> >
> >
> >
> > Alfred P. Reaud
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Per W. <pw...@ia...> - 2004-12-15 21:51:14
|
Are you sure that the beChannel object really have a valid pointer to your
beMDIWindow object.
Also, note that qDebug() which I don't know what it does might be
dangerous in case you have a multi-threaded application. Only the thread
that owns the MDI window should try and used any GDI objects.
/Per W
On Wed, 15 Dec 2004, Black Eagle wrote:
> Hi guys!
>
> I got a problem at run time, when using a pointer in a function.
>
> The error is in the function KviIrcServer* server() at line : return m_pSrv;
>
> In all other functions I got no problem with this variable. It is another
> class that tries to call this function, it's the friendclass beChannel
>
>
> Here is the beConsole.h
>
> #ifndef BE_CONSOLE_H
> #define BE_CONSOLE_H
>
> #include "beMDIWindow.h"
>
> class KviIrcServer;
>
> class beConsole : beMDIWindow
> {
> friend class beIRC;
> friend class beChannel;
> Q_OBJECT
> public :
> beConsole(QWidget * parent = 0, const char * name = 0, WFlags f = 0);
> ~beConsole();
>
> KviIrcServer* server();
> protected :
> bool connectToServer();
> private slots :
>
> virtual void hostFound();
> virtual void connected();
> virtual void socketReadyRead();
> virtual void disconnected();
> void send(const QString & command);
> private :
> KviIrcServer * m_pSrv;
> // KviProxy * prx;
>
> QSocket * m_pQSocket;
> };
>
> #endif
>
> And here is the beConsole.cpp
> // beIRC stuff
> #include "beConsole.h"
> // kvirc stuff
> #define HAVE_CONFIG_H
> #include "config.h"
> #include <kvirc/3.0.1/kvi_app.h>
> #include <kvirc/3.0.1/kvi_ircserverdb.h>
> #include <kvirc/3.0.1/kvi_confignames.h>
> // QT Stuff
> #include <qregexp.h>
> #include <qsocket.h>
>
> extern KVIRC_API KviIrcServerDataBase * g_pIrcServerDataBase;
>
> beConsole::beConsole(QWidget * parent,const char * name, WFlags f) :
> beMDIWindow(parent,name,f)
> {
> m_windowType = beMDIWindow::Console;
>
> KviIrcNetwork * net = g_pIrcServerDataBase->currentNetwork();
>
> if(net)m_pSrv = net->currentServer();
> QString srvname = m_pSrv->hostname();
> setCaption(srvname);
> connect ( this, SIGNAL( userInput(const QString &) ), this, SLOT ( send(const
> QString &) ) );
> }
>
> beConsole::~beConsole()
> {
> delete m_pSrv;
> }
>
> bool beConsole::connectToServer()
> {
> if(!m_pSrv) { return false; }
> // QString text = "Connect to server";
> // m_pLineView->addLine(text);
> // \n for new liens
> // \t for tabs
> append("<mytag>Connecting to server...</mytag>");
>
> m_pQSocket = new QSocket(this);
> connect( m_pQSocket, SIGNAL( hostFound() ), this, SLOT( hostFound() ) );
> connect( m_pQSocket, SIGNAL( connected() ), this, SLOT( connected() ) );
> connect( m_pQSocket, SIGNAL( readyRead() ), this, SLOT(socketReadyRead()) );
> connect( m_pQSocket, SIGNAL( connectionClosed() ), this,
> SLOT( disconnected() ));
> m_pQSocket->connectToHost( m_pSrv->hostname(), m_pSrv->port() );
> return true;
> }
>
>
> void beConsole::hostFound()
> {
> append("<mytag>Host found ...</mytag>");
> }
>
> void beConsole::connected()
> {
> append("<mytag>Connected to "+m_pSrv->hostname()+"</mytag>");
> QString cmd;
> cmd = "USER alex 0 "+m_pSrv->hostname()+" :Using beIRC 0.0.1\n";
> m_pQSocket->writeBlock( cmd.latin1(), cmd.length() );
> cmd = "NICK blackeagle654\n";
> m_pQSocket->writeBlock( cmd.latin1(), cmd.length() );
> }
>
> void beConsole::socketReadyRead()
> {
> // append("<mytag>Socket is ready to read</mytag>");
> while ( m_pQSocket->canReadLine() ) {
>
> QString msg = m_pQSocket->readLine();
> QRegExp rxA("(.*)\n$");
> rxA.search( msg );
> append( rxA.cap(1) );
> /* BEGIN ping pong fast reply */
> QRegExp rx("^PING :([0-9]+)");
> int pos;
> if( (pos = rx.search(msg)) != -1)
> {
> QString cmd = "PONG :"+rx.cap(1)+"\n";
> m_pQSocket->writeBlock( cmd.latin1(), cmd.length() );
> }
> /* END ping pong fast reply */
> QRegExp rx2("376.*End of /MOTD command");
> if( (pos = rx2.search(msg)) != -1)
> {
> QString cmd = "JOIN #gentoo\n";
> m_pQSocket->writeBlock( cmd.latin1(), cmd.length() );
> }
> }
> }
>
> void beConsole::disconnected()
> {
> append("<mytag>Disconnected from server</mytag>");
> }
>
> void beConsole::send(const QString & command)
> {
> append("<command>"+command+"</command>");
> // command.append("\n");
> QString tmp = command+"\n";
> m_pQSocket->writeBlock( tmp.latin1(), tmp.length() );
> }
>
> KviIrcServer* beConsole::server()
> {
> qDebug("returning server");
> return m_pSrv;
> }
>
>
> Thanks for any help !
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Black E. <bla...@ea...> - 2004-12-15 21:42:49
|
It's tricky but I think I got it
In fact I am returning a pointer to m_pSrv which is a pointer itself, rathe=
r=20
than the adress of the class, right ?
What could have worked is if m_pSrv was the class and that I returned &m_pS=
rv,=20
the adress of the class.
But I've done like this :
KviIrcServer beConsole::server()
{
qDebug("returning server");
return *m_pSrv;
}
Thanks for help !
Le mercredi 15 D=E9cembre 2004 22:06, Alfred P. Reaud a =E9crit :
> Hi Black Eagle,
>
> It could be that you are returning the address of m_pSrv rather than it's
> contents. You've declared m_pSrv as a pointer to a KviIrcServer class.=20
> However, in server(), you return m_pSrv, rather than it's contents *m_pSr=
v.
> server() is declared as returning a pointer to the class, which is the
> value of m_pSrv, not it's address.
>
> Hope that makes sense!
>
> Black Eagle <bla...@ea...> wrote:
>
> Hi guys!
>
> I got a problem at run time, when using a pointer in a function.
>
> The error is in the function KviIrcServer* server() at line : return
> m_pSrv;
>
> In all other functions I got no problem with this variable. It is another
> class that tries to call this function, it's the friendclass beChannel
>
>
> <snip>
> class KviIrcServer;
> <snip>
> KviIrcServer* server();
> <snip>
> private :
> KviIrcServer * m_pSrv;
> <snip>
> KviIrcServer* beConsole::server()
> {
> qDebug("returning server");
> return m_pSrv;
> }
> <snip>
>
>
>
>
> Alfred P. Reaud
|
|
From: Alfred P. R. <al...@ya...> - 2004-12-15 21:06:28
|
Hi Black Eagle,
It could be that you are returning the address of m_pSrv rather than it's contents. You've declared m_pSrv as a pointer to a KviIrcServer class. However, in server(), you return m_pSrv, rather than it's contents *m_pSrv. server() is declared as returning a pointer to the class, which is the value of m_pSrv, not it's address.
Hope that makes sense!
Black Eagle <bla...@ea...> wrote:
Hi guys!
I got a problem at run time, when using a pointer in a function.
The error is in the function KviIrcServer* server() at line : return m_pSrv;
In all other functions I got no problem with this variable. It is another
class that tries to call this function, it's the friendclass beChannel
<snip>
class KviIrcServer;
<snip>
KviIrcServer* server();
<snip>
private :
KviIrcServer * m_pSrv;
<snip>
KviIrcServer* beConsole::server()
{
qDebug("returning server");
return m_pSrv;
}
<snip>
Alfred P. Reaud
|
|
From: Black E. <bla...@ea...> - 2004-12-15 20:30:05
|
Hi guys!
I got a problem at run time, when using a pointer in a function.
The error is in the function KviIrcServer* server() at line : return m_pSrv;
In all other functions I got no problem with this variable. It is another
class that tries to call this function, it's the friendclass beChannel
Here is the beConsole.h
#ifndef BE_CONSOLE_H
#define BE_CONSOLE_H
#include "beMDIWindow.h"
class KviIrcServer;
class beConsole : beMDIWindow
{
friend class beIRC;
friend class beChannel;
Q_OBJECT
public :
beConsole(QWidget * parent = 0, const char * name = 0, WFlags f = 0);
~beConsole();
KviIrcServer* server();
protected :
bool connectToServer();
private slots :
virtual void hostFound();
virtual void connected();
virtual void socketReadyRead();
virtual void disconnected();
void send(const QString & command);
private :
KviIrcServer * m_pSrv;
// KviProxy * prx;
QSocket * m_pQSocket;
};
#endif
And here is the beConsole.cpp
// beIRC stuff
#include "beConsole.h"
// kvirc stuff
#define HAVE_CONFIG_H
#include "config.h"
#include <kvirc/3.0.1/kvi_app.h>
#include <kvirc/3.0.1/kvi_ircserverdb.h>
#include <kvirc/3.0.1/kvi_confignames.h>
// QT Stuff
#include <qregexp.h>
#include <qsocket.h>
extern KVIRC_API KviIrcServerDataBase * g_pIrcServerDataBase;
beConsole::beConsole(QWidget * parent,const char * name, WFlags f) :
beMDIWindow(parent,name,f)
{
m_windowType = beMDIWindow::Console;
KviIrcNetwork * net = g_pIrcServerDataBase->currentNetwork();
if(net)m_pSrv = net->currentServer();
QString srvname = m_pSrv->hostname();
setCaption(srvname);
connect ( this, SIGNAL( userInput(const QString &) ), this, SLOT ( send(const
QString &) ) );
}
beConsole::~beConsole()
{
delete m_pSrv;
}
bool beConsole::connectToServer()
{
if(!m_pSrv) { return false; }
// QString text = "Connect to server";
// m_pLineView->addLine(text);
// \n for new liens
// \t for tabs
append("<mytag>Connecting to server...</mytag>");
m_pQSocket = new QSocket(this);
connect( m_pQSocket, SIGNAL( hostFound() ), this, SLOT( hostFound() ) );
connect( m_pQSocket, SIGNAL( connected() ), this, SLOT( connected() ) );
connect( m_pQSocket, SIGNAL( readyRead() ), this, SLOT(socketReadyRead()) );
connect( m_pQSocket, SIGNAL( connectionClosed() ), this,
SLOT( disconnected() ));
m_pQSocket->connectToHost( m_pSrv->hostname(), m_pSrv->port() );
return true;
}
void beConsole::hostFound()
{
append("<mytag>Host found ...</mytag>");
}
void beConsole::connected()
{
append("<mytag>Connected to "+m_pSrv->hostname()+"</mytag>");
QString cmd;
cmd = "USER alex 0 "+m_pSrv->hostname()+" :Using beIRC 0.0.1\n";
m_pQSocket->writeBlock( cmd.latin1(), cmd.length() );
cmd = "NICK blackeagle654\n";
m_pQSocket->writeBlock( cmd.latin1(), cmd.length() );
}
void beConsole::socketReadyRead()
{
// append("<mytag>Socket is ready to read</mytag>");
while ( m_pQSocket->canReadLine() ) {
QString msg = m_pQSocket->readLine();
QRegExp rxA("(.*)\n$");
rxA.search( msg );
append( rxA.cap(1) );
/* BEGIN ping pong fast reply */
QRegExp rx("^PING :([0-9]+)");
int pos;
if( (pos = rx.search(msg)) != -1)
{
QString cmd = "PONG :"+rx.cap(1)+"\n";
m_pQSocket->writeBlock( cmd.latin1(), cmd.length() );
}
/* END ping pong fast reply */
QRegExp rx2("376.*End of /MOTD command");
if( (pos = rx2.search(msg)) != -1)
{
QString cmd = "JOIN #gentoo\n";
m_pQSocket->writeBlock( cmd.latin1(), cmd.length() );
}
}
}
void beConsole::disconnected()
{
append("<mytag>Disconnected from server</mytag>");
}
void beConsole::send(const QString & command)
{
append("<command>"+command+"</command>");
// command.append("\n");
QString tmp = command+"\n";
m_pQSocket->writeBlock( tmp.latin1(), tmp.length() );
}
KviIrcServer* beConsole::server()
{
qDebug("returning server");
return m_pSrv;
}
Thanks for any help !
|
|
From: Alfred P. R. <al...@ya...> - 2004-12-15 20:26:37
|
Hi Mohamad, Just use Google for 'tutorial c++ x', where x is autoconf, automake, etc. You should be able to find what you want on-line. mohamad chaitou <moh...@in...> wrote: Hi, I search some tutorials to begin building projects over j++, precisely i need to learn about autoconf, automake and which macro language we use to edit configure.in and Makefile.am. Can anybody guide me to some useful tutorials about these topics? Thanks in adavance <snip> Alfred P. Reaud |
|
From: mohamad c. <moh...@in...> - 2004-12-15 16:58:37
|
excuse me i meant g++ and not j++ Thank you |
|
From: mohamad c. <moh...@in...> - 2004-12-15 16:46:36
|
Hi, I search some tutorials to begin building projects over j++, precisely i need to learn about autoconf, automake and which macro language we use to edit configure.in and Makefile.am. Can anybody guide me to some useful tutorials about these topics? Thanks in adavance |
|
From: Per W. <pw...@ia...> - 2004-12-15 10:37:52
|
The problem is that it isn't enough to add an include file to your source.
You must also add the corresponding library file (libXX.a) to the project.
Specify -libXX in the linker options.
/Per W
On Wed, 15 Dec 2004, mohamad chaitou wrote:
> Hi all,
> I'm new to g++. I'm trying to use a new library for linear algebra
> called Lapack++, the problem is when I include this library into a
> source file I get errors of kinds "undefined refernce". for example this
> little and stupid code:
> #define LA_COMPLEX_SUPPORT
> #include <lapack++.h> // the new library
> #include <iostream>
> int main()
> {
> LaGenMatDouble A ; // this uses the new library
> std::cout<< "This is a test "<< std::endl;
> return 0;
> }
> the erros are like:
> /tmp/cc2YU0wo.o(.text+0x19): In function `main':
> undefined reference to =AB LaGenMatDouble::LaGenMatDouble[in-charge]()=BB
>
> What could be the problem?
> Please give me some feddback.
> thanks in advance
>
>
>
>
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: mohamad c. <moh...@in...> - 2004-12-15 09:19:15
|
Hi all,
I'm new to g++. I'm trying to use a new library for linear algebra=20
called Lapack++, the problem is when I include this library into a=20
source file I get errors of kinds "undefined refernce". for example this=20
little and stupid code:
#define LA_COMPLEX_SUPPORT
#include <lapack++.h> // the new library
#include <iostream>
int main()
{
LaGenMatDouble A ; // this uses the new library=20
std::cout<< "This is a test "<< std::endl;
return 0;
}
the erros are like:
/tmp/cc2YU0wo.o(.text+0x19): In function `main':
undefined reference to =AB LaGenMatDouble::LaGenMatDouble[in-charge]()=BB
What could be the problem?
Please give me some feddback.
thanks in advance
|