|
When I try running a Qt application with the following main.cpp file:
#include <QApplication>
#include "ui_checkabder.h"
#include <QDialog>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Ui::CheckAbder ui;
QDialog *dialog = new QDialog;
ui.setupUi(dialog);
dialog->show();
return app.exec();
}
I get the following errors:
c:/QtSDK/Desktop/Qt/4.7.3/mingw/lib/libqtmaind.a(qtmain_win.o):-1: In function `WinMain@16':
c:/ndk_buildrepos/qt-desktop/src/winmain/qtmain_win.cpp:131: error: undefined reference to qMain(int, char **)
:-1: error: collect2: ld returned 1 exit status
And, abder.pro looks like this:
######################################################################
# Automatically generated by qmake (2.01a) Mon Apr 18 09:52:56 2011
######################################################################
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
# Input
FORMS += checkabder.ui
How can I solve those errors? Provided that I'm using Qt Creator.
Thanks.
|
|
|
|
|
This is not really a C/C++ issue as such; you would probably get better help here[^].
|
|
|
|
|
|
Hi ,
I am using CabLib.Dll(8.1.0.0) file for compressing in .Net.
It works perfectly alright.
I am using cablib.CompressFolder method.
But if the file name consists of odd number of special character '%'(Percentage) it causes the application to crash.For even number of '%' its working fine.
Any ideas what might be the problem.It's working for file name with other special characters '@','#','$','&' n all.
If I use the latest cabLib.dll the application doesn't crashes but the compressed filename is not the desired one with a different name altogether.
for eg;
If I give the file name to be 90%.cab it crashes.(odd)
But if I give it as 90%%.cab(even) it works but the output file name will be 90%.cab
Is there anyway to overcome this situation.
Code Snippet:
1)CabLib.Compress compressProj = new CabLib.Compress();
2)compressProj.CompressFolder(this.workingFolder, configurationFile, "*.*", b_UtcTime, s32_SplitSize);
While debugging in .Net it crashes on the 2) line.
It shows the error : (Microsoft Visual C++ Runtime Error)
R6002 floating point support not loaded while saving
Could you please help us to sort-out the issue.
Regards
Tomy
|
|
|
|
|
Assuming that cablib is a Microsoft product you should report it to Microsoft support. It would appear (from your problem description) that filenames with '%' characters are being used in the format portion of print or format statements, giving the results that you see.
|
|
|
|
|
i want to drag and drop image in a listview item
|
|
|
|
|
|
Hi!
I've deployed my application using visual studio Deployment project. I've added an uninstaller using the batch file. This file contains:
%windir%\system32\msiexec /x {650ED5B7-1EDA-40F8-B8A9-614150FCE744} /qr
When I uninstall some folders and files are not uninstalled. These are all downloaded from Internet. What else has to be done to Uninstall with out leaving folder or files?
|
|
|
|
|
|
hello friends
I want to know that can I use one setWindowLong procedure for more than one window id?
I am having too many window Id so can I call one Procedure for all windows id?
And If yes then How can i differentiate in procedure?
Thanks & Regards
Yogesh
|
|
|
|
|
Your question is not very clear; what are you trying to achieve? You can differentiate between Windows by various parameters such as class or user defined type.
|
|
|
|
|
Hello
I am calling a window procedure on right click of an event and am having such around 15 types of event.
for every Right click Procedure i am using setWindowLong like this:
wpOrigPPProc1 = (WNDPROC) SetWindowLong(GetDlgItem(hwndDlg,IDC_LEFT1), GWL_WNDPROC, (LONG) PPSubclassProc1);
wpOrigPPProc2 = (WNDPROC) SetWindowLong(GetDlgItem(hwndDlg,IDC_LEFT2), GWL_WNDPROC, (LONG) PPSubclassProc2);
.
.
.
and so on.
I want to use only one windowProcedure.
Is this possible or every Windowid needs separate procedure?
regards
Yogesh
|
|
|
|
|
yogeshs wrote: I want to use only one windowProcedure. Is this possible or every Windowid needs separate procedure?
Without knowing what your code is trying to do it's impossible to say for sure. However as a generalisation this should work, assuming you are able to make the correct decisions in your code according to the type of window that generates the message or notification.
|
|
|
|
|
I want to get String as : "6.591E+02" from text file,and transfer it to float.My file have a form:
STT x y
1 6.591E+02 8.575E+02
2 7.350E+02 9.289E+02
3 7.234E+02 1.078E+03
4 6.844E+02 1.191E+03
5 5.951E+02 1.306E+03
6 4.125E+02 1.259E+03
my code as:
CString m_file;<br />
UINT nOpenFlags;<br />
nOpenFlags = CFile ::modeRead|CFile ::modeCreate;<br />
UpdateData(TRUE);<br />
CFileDialog dlg(TRUE,0,0,OFN_HIDEREADONLY | OFN_FILEMUSTEXIST,"All Files (*.txt)|*.txt||");<br />
if (dlg.DoModal()==IDCANCEL) return;<br />
m_file=dlg.GetPathName();<br />
<br />
int i,count,j;<br />
count =0;<br />
UINT nOpenFlags1;<br />
CStdioFile Inputfile;<br />
CFileException File;<br />
CString s;<br />
tamthoi="";<br />
nOpenFlags1=CFile ::modeRead;<br />
if(!Inputfile.Open(m_file,nOpenFlags1,&File))<br />
{<br />
File.ReportError();<br />
}<br />
while(Inputfile.ReadString(s))<br />
{<br />
count++;<br />
tamthoi+=s;<br />
}<br />
Inputfile.Close();<br />
count_line=count;<br />
if(!Inputfile.Open(m_file,nOpenFlags1,&File))<br />
{<br />
File.ReportError();<br />
}<br />
m_Listfile.ResetContent();<br />
for(i=0;i<count_line;i++)<br />
{<br />
Inputfile.ReadString(s);<br />
m_Listfile.AddString(s);<br />
}<br />
Inputfile.Close();<br />
CStringArray cx,cy;<br />
cx.SetSize(count_line);<br />
cy.SetSize(count_line);<br />
x= new float[count_line];<br />
y= new float [count_line];<br />
for (i=1;i<count_line;i++)<br />
{<br />
int c;<br />
char *kytux,*kytuy;<br />
c=tamthoi.Find(" ",21*(i-1)+9);<br />
cx[i]=tamthoi.Mid(c+1,9);<br />
cy[i]=tamthoi.Mid(c+6,9);<br />
sscanf(cx[i],"&c",&kytux);<br />
sscanf(cx[i],"&c",&kytuy);<br />
x[i]=atof(kytux);<br />
y[i]=atof(kytuy);<br />
}<br />
UpdateData(FALSE);
|
|
|
|
|
Please mention the exact problem that you're facing.
You could understand the problem better by putting a breakpoint and then single stepping through the code in the debugger.
|
|
|
|
|
My problem is when i want show a result at Editbox(only show a element of array) then it's errored,and Editbox don't show anything. I want to know be this code errored?:
for (i=1;i<count_line;i++)<br />
{<br />
int c;<br />
char *kytux,*kytuy;<br />
c=tamthoi.Find(" ",21*(i-1)+9);<br />
cx[i]=tamthoi.Mid(c+1,9);<br />
cy[i]=tamthoi.Mid(c+6,9);<br />
sscanf(cx[i],"&c",&kytux);<br />
sscanf(cx[i],"&c",&kytuy);<br />
x[i]=atof(kytux);<br />
y[i]=atof(kytuy);
|
|
|
|
|
camuoi288 wrote: sscanf(cx[i],"&c",&kytux);
Your format constant is incorrect (should be "%c" ), and you are trying to store the response into an uninitialised (and wrong type of) variable. If cx[i] already contains a single character then why are you using sscanf() ?
Also please use <pre></pre> tags around your code (and indentation) to make it readable, like this:
for (i=1; i > count_line; i++)
{
int c;
char *kytux,*kytuy;
c=tamthoi.Find(" ",21*(i-1)+9);
cx[i]=tamthoi.Mid(c+1,9);
cy[i]=tamthoi.Mid(c+6,9);
sscanf(cx[i],"&c",&kytux);
sscanf(cx[i],"&c",&kytuy);
x[i]=atof(kytux);
y[i]=atof(kytuy);
|
|
|
|
|
camuoi288 wrote: sscanf(cx[i],"&c",&kytux); sscanf(cx[i],"&c",&kytuy);
Seems strange to attempt to put cx[i] into both kytux and kytuy .
Why not try:
x[i] = atof(cx[i]);
y[i] = atof(cy[i]);
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
|
|
|
|
|
Hi,
Is it possible to know that the choosen printer is a PDF printer? And this programmaticaly?
Thanks,
Claude
|
|
|
|
|
Hi All,
I am tring to figure out is it possible to get the proxy type using C/C++ code.
Lets say i have an IP and Port of a proxy server.
I use it in my code and now my code works using a proxy, so my IP needs to be hide to the world...
I can do some, easy, test to see if the proxy is working or not.
But the thing i realy want to know is what is the proxy type, SOCKS4/5, anonymous/ High anonymous/ Elite one... and so on.
Do you know if there is a way to get this information, re by header info, special value etc.
Thanks a lot for your help,
Ram.
|
|
|
|
|
Hi, I need some help combining these two blocks of if statements. Thanks.
if(segments_comp[head_comp]->panel->Left <= Food->Left)
{
if(segments_comp[head_comp]->panel->Top >= Food->Top){direction_comp =2;}
else{direction_comp=-1;}
}
else if(segments_comp[head_comp]->panel->Left >= Food->Left)
{
if(segments_comp[head_comp]->panel->Top >= Food->Top){direction_comp =2;}
else{direction_comp=1;}
}
if(segments_comp[head_comp]->panel->Top <= Food->Top)
{
if(segments_comp[head_comp]->panel->Left <= Food->Left){direction_comp =-1;}
else{direction_comp=-2;}
}
else if(segments_comp[head_comp]->panel->Top >= Food->Top)
{
if(segments_comp[head_comp]->panel->Left >= Food->Left){direction_comp =1;}
else{direction_comp=2;}
}
|
|
|
|
|
that code is pretty bad, you essentially overwrite direction_comp in the second set of if/else statements, therefore it doesn't matter what the first one does, so combining them is as easy as just keeping the second block
if(segments_comp[head_comp]->panel->Top <= Food->Top)
{
if(segments_comp[head_comp]->panel->Left <= Food->Left)
direction_comp =-1;
else
direction_comp=-2;
}
else
{
if(segments_comp[head_comp]->panel->Left >= Food->Left)
direction_comp =1;
else
direction_comp=2;
}
|
|
|
|
|
Thanks. That code works better.
|
|
|
|
|
Hi all,
i m using this
char buffer[250];
CString str=_T("Test");
strcpy_s(buffer, str);
and this error 'strcpy_s' : none of the 2 overloads could convert all the argument types
comes please help me to resolve this.
|
|
|
|
|
This is happening because you are compiling for Unicode (UNICODE and/or _UNICODE is defined).
If you check on this MSDN page: http://msdn.microsoft.com/en-us/library/td1esda9%28v=vs.80%29.aspx[^] you will see that there is no overload that takes (char *, wchar_t *) (which is what you are passing; the CString in Unicode builds is wchar_t). So you have to convert your char string to wchar_t, or convert your CString to char. Or, don't build for Unicode.
|
|
|
|