[Qt-interest] Problems launching project: "An unhandled win32 exception occurred in Backoffice.exe [216]."
jaff at student.dei.uc.pt
jaff at student.dei.uc.pt
Wed Aug 4 19:20:41 CEST 2010
Hi all,
Ok, while using Qt Creator somewhat and from out of nowhere (at least,
from what my memory recalls) I started having problems launching my Qt
application. I does build fine, but when I try to launch it (ctrl+R),
immediately appears a pop-up with the title "Visual Studio Just-In-Time
Debugger" and the text "An unhandled win32 exception occurred in
Backoffice.exe [216].", asking me if I want to launch a new instance of
Visual Studio 2008 to debug it.
Since it's not the first time odd things happen me in Qt Creator, I
immediately commented the last changes made to the code, and tried to
clean/rebuild the project and searched Google to see if someone had the
same problems I did, but I only found similar problems, not equal ones.
I also looked at the project configuration but didn't find anything
suspicious and even saved my files, deleted the project and created a
new one, but the situation didn't changed a thing.
So did anyone have had the same problem, and if yes, how did you solved
it? Btw I'm using Qt Creator 2.0.0 based on Qt 4.7.0 (in Windows XP SP3
32 bit). I attached the code if someone thinks it's important.
Thank you very much,
João
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
-------------- next part --------------
#ifndef LOGINDIALOG_H
#define LOGINDIALOG_H
#include <QDialog>
#include <QtNetwork/QTcpSocket>
#include <QtNetwork/QHostAddress>
#include <QString>
//#include <iostream>
//enum RESPONSES { LOGIN_ACCEPTED, LOGIN_REFUSED, LOGGED_OUT, UNIMPLEMENTED }; /* responses given by the server */
//enum REQUESTS { LOGIN, LOGOUT, SERVER_INFO, ACCESS_LOG, ACTIVITY_LOG, ERROR_LOG } ; /* requests sent to server */
namespace Ui
{
class LoginDialog;
}
class LoginDialog : public QDialog
{
Q_OBJECT
public:
explicit LoginDialog(QWidget *parent = 0);
~LoginDialog();
public slots:
void clearButtonClickedHandler();
void connectToServer();
void showMainWindow();
void sendLoginInformation();
void receiveServerResponse();
private:
Ui::LoginDialog *ui;
QTcpSocket* tcpSocket;
};
#endif // LOGINDIALOG_H
-------------- next part --------------
#include "logindialog.h"
#include "ui_logindialog.h"
#include "mainwindow.h"
//using namespace std;
LoginDialog::LoginDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::LoginDialog)
{
ui->setupUi(this);
ui->lineEdit_2->setEchoMode(QLineEdit::Password);
connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(receiveServerResponse ()));
}
LoginDialog::~LoginDialog()
{
tcpSocket->close();
delete ui;
}
void LoginDialog::clearButtonClickedHandler()
{
ui->lineEdit->clear();
ui->lineEdit_2->clear();
ui->lineEdit_3->clear();
}
void LoginDialog::connectToServer()
{
QString server = ui->lineEdit_3->text();
if(server.isEmpty())
{
ui->lineEdit_3->setText("localhost (127.0.0.1)");
tcpSocket->abort();
tcpSocket->connectToHost(QHostAddress::LocalHost, 44444);
sendLoginInformation ();
// recebe mensagem de resposta do servidor
receiveServerResponse ();
}
else
tcpSocket->connectToHost(server, 44444);
}
void LoginDialog::sendLoginInformation ()
{
QString userName, password;
/* block details (messageType = 1)
--------------------------------------------------
| blockSize | messageType | userName | password |
| quint32 | quint16 | QString | QString |
--------------------------------------------------
*/
QByteArray request;
QDataStream out(&request, QIODevice::WriteOnly);
out.setVersion(QDataStream::Qt_4_0);
userName = ui->lineEdit->text();
password = ui->lineEdit_2->text();
out << quint32(0) << quint16(1) << userName << password; // blockSize << messageType
out.device()->seek(0);
out << quint32(request.size() - sizeof(quint32));
tcpSocket->write(request);
}
void LoginDialog::receiveServerResponse ()
{
quint32 blockSize = 0;
quint16 responseType;
bool authentication;
//cout << "Receiving data... ";
QDataStream in(tcpSocket);
in.setVersion(QDataStream::Qt_4_0);
if (blockSize == 0)
{
if (tcpSocket->bytesAvailable() < (int)sizeof(quint32))
return;
in >> blockSize;
}
if (tcpSocket->bytesAvailable() < blockSize)
return;
in >> responseType >> authentication;
/* block details (responseType = 1)
---------------------------------------------
| blockSize | responseType | authentication |
| quint32 | quint16 | Qboolean |
---------------------------------------------
*/
//cout << " finished." << endl;
if (authentication)
showMainWindow();
else
return;
}
void LoginDialog::showMainWindow()
{
MainWindow* m = new MainWindow(this);
this->close();
m->show();
}
-------------- next part --------------
#include <QtGui/QApplication>
#include "logindialog.h"
//#include <iostream>
//using namespace std;
int main(int argc, char *argv[])
{
// cout << "início" << endl;
// cout.flush();
QApplication a(argc, argv);
LoginDialog w;
w.show();
return a.exec();
}
-------------- next part --------------
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTimer>
//#include <iostream>
#include <QtNetwork/QTcpSocket>
namespace Ui
{
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0, QTcpSocket *socket = 0);
~MainWindow();
public slots:
// void updateStatus();
// void updateDatabaseInfo();
// void updateNumberOfClients();
// void readResponse();
private:
Ui::MainWindow *ui;
QTcpSocket* tcpSocket;
QTimer* timer1;
QTimer* timer2;
QTimer* timer3;
};
#endif // MAINWINDOW_H
-------------- next part --------------
#include "mainwindow.h"
#include "ui_mainwindow.h"
//using namespace std;
MainWindow::MainWindow(QWidget *parent, QTcpSocket *socket) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
// cout << "cenas!" << endl;
// timer1 = new QTimer(this);
// QObject::connect(timer1, SIGNAL(timeout()), this, SLOT(updateStatus()));
// timer1->start(1000);
// timer2 = new QTimer(this);
// QObject::connect(timer2, SIGNAL(timeout()), this, SLOT(updateDatabaseInfo()));
// timer2->start(1000);
// timer3 = new QTimer(this);
// QObject::connect(timer3, SIGNAL(timeout()), this, SLOT(updateNumberOfClients()));
// timer3->start(1000);
tcpSocket = socket;
//connect(tcpSocket, SIGNAL(readyRead()), this, SLOT(readResponse()));
}
MainWindow::~MainWindow()
{
timer1->stop();
timer2->stop();
timer3->stop();
delete ui;
}
//void MainWindow::updateStatus()
//{
// //cout << "bacalhau" << endl;
// /* block details (messageType = 2)
// ---------------------------
// | blockSize | messageType |
// | quint32 | quint16 |
// ---------------------------
// */
// QByteArray request;
// QDataStream out(&request, QIODevice::WriteOnly);
// out.setVersion(QDataStream::Qt_4_0);
// out << quint32(0) << quint16(2); // blockSize << messageType
// out.device()->seek(0);
// out << quint32(request.size() - sizeof(quint32));
// tcpSocket->write(request);
//}
//void MainWindow::updateDatabaseInfo()
//{
// //cout << "cebolas" << endl;
// /* block details (messageType = 3)
// ---------------------------
// | blockSize | messageType |
// | quint32 | quint16 |
// ---------------------------
// */
// QByteArray request;
// QDataStream out(&request, QIODevice::WriteOnly);
// out.setVersion(QDataStream::Qt_4_0);
// out << quint32(0) << quint16(3); // blockSize << messageType
// out.device()->seek(0);
// out << quint32(request.size() - sizeof(quint32));
// tcpSocket->write(request);
//}
//void MainWindow::updateNumberOfClients()
//{
// //cout << "nozes" << endl;
// /* block details (messageType = 4)
// ---------------------------
// | blockSize | messageType |
// | quint32 | quint16 |
// ---------------------------
// */
// QByteArray request;
// QDataStream out(&request, QIODevice::WriteOnly);
// out.setVersion(QDataStream::Qt_4_0);
// out << quint32(0) << quint16(4); // blockSize << messageType
// out.device()->seek(0);
// out << quint32(request.size() - sizeof(quint32));
// tcpSocket->write(request);
//}
//void MainWindow::readResponse()
//{
// quint32 blockSize = 0, numberOfSongs, size;
// quint16 responseType;
// QString status, numberOfClients;
// cout << "Receiving data... ";
// QDataStream in(tcpSocket);
// in.setVersion(QDataStream::Qt_4_0);
// if (blockSize == 0)
// {
// if (tcpSocket->bytesAvailable() < (int)sizeof(quint32))
// return;
// in >> blockSize;
// }
// if (tcpSocket->bytesAvailable() < blockSize)
// return;
// in >> responseType;
// switch(responseType)
// {
// case 1: // status
// {
// /* block details (responseType = 2)
// --------------------------------------
// | blockSize | responseType | status |
// | quint32 | quint16 | QString |
// --------------------------------------
// */
// in >> status;
// ui->label_14->setText(status);
// break;
// }
// case 2: // number of clients
// {
// /* block details (responseType = 3)
// ----------------------------------------------
// | blockSize | responseType | numberOfClients |
// | quint32 | quint16 | QString |
// ----------------------------------------------
// */
// in >> numberOfClients;
// ui->label_16->setText(numberOfClients);
// break;
// }
// case 3: // number of songs / size
// {
// /* block details (responseType = 4)
// ------------------------------------------------------
// | blockSize | responseType | numberOfSongs | size |
// | quint32 | quint16 | quint32 | quint32 |
// ------------------------------------------------------
// */
// in >> numberOfSongs >> size;
// ui->label_19->setText(numberOfClients+" ("+numberOfSongs+") MB");
// break;
// }
// }
//}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Backoffice.pro
Type: application/octet-stream
Size: 388 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100804/cb06f224/attachment.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logindialog.ui
Type: application/x-designer
Size: 3296 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100804/cb06f224/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mainwindow.ui
Type: application/x-designer
Size: 13025 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100804/cb06f224/attachment-0001.bin
More information about the Qt-interest-old
mailing list