|
No, the assignment is to add duplicates, but when show the list to show it without them. I think the sort thing will do the job but can' t do it properly.
modified on Monday, April 18, 2011 4:57 PM
|
|
|
|
|
ok, then i would recommend sorting the nodes on input. it is far more efficient than sorting the whole list, and it's actually fairly straightforward. (i outlined it above)
unfortunately, i have to leave for the day. so.. good luck!
|
|
|
|
|
I posted a question on the quick questions and answers board and I got some helpful advice. Here's the link: Where-to-look-for-my-project-goal[^]
This will give you the basics of my goal. Any way I created a blog to chronicle my progress toward that goal and would like some input from time to time on my blog to help me along in the learning process. Please bear in mind that I am a novice and am completely self taught through trial an error with mostly error. Now I have decided to stop dabbling and blundering through trying to learn programming and actually learn something useful.
What I need at this point are helpful comments and nudges that will point me in the right direction or let me know if I am getting it. My project is very ambitious to say the least and is probably impossibly high but is my motivation to learn.
Ok enough babbling here's the link to my blog: thegreatproject.wordpress.com[^]
|
|
|
|
|
Hi All,
I am tring to write an application that open a web page and Copy its data to the clipboard.
I know i can use function to httpRead the page into a buffer, but in this case i have all the html's tags
and i do not need them, if i use copy (CTRL+C) i am able to only get the text.
I thought to open an IE process with the url as parameter and then use the SendMessage API with the process handle and the CTRL+A as the message and then CTRL+C as the message (hopefully it will generate a Select All and Copy).
If this works would it be able to work when the user is logout (no visible UI).
Love to hear your thought about it, i am working with C++ or C# on windows.
Thanks a lot for your time,
Ram.
modified on Wednesday, April 20, 2011 2:11 AM
|
|
|
|
|
Ram Shmider wrote: and i do not need them, if i use copy (CTRL+C) i am able to only get the text.
Can you parse the HTML content using some class for ex: HTML Reader C++ Class Library[^]
You talk about Being HUMAN. I have it in my name
AnsHUMAN
|
|
|
|
|
|
Hi Ram,
This is possible and your thinking is correct. Only you need is to get focus to the browser control then simulate the Ctrl+A and Ctrl+C using SendInput API. So in your code you need to wait for the browser window to appear and find the browser control then give focus to that by sending SetFocus. now simulate the keystrokes. But there always a chance for something unexpected results since any other window activation will make your task difficult.
hope this helps
Nitheesh George
http://www.simpletools.co.in
|
|
|
|
|
Thanks a lot for the help, it realy helps... by using SendInput i was able to solved it.
This is a the part code i use...(C++)
INPUT input;
input.type = INPUT_KEYBOARD;
// ctrl down
input.ki.wVk = VK_LCONTROL;
input.ki.dwFlags = 0;
SendInput(1, &input, sizeof(INPUT));
Sleep(50);
// C down
input.ki.wVk = 'C';
SendInput(1, &input, sizeof(INPUT));
Sleep(50);
// C up
input.ki.dwFlags = KEYEVENTF_KEYUP;
SendInput(1, &input, sizeof(INPUT));
Sleep(50);
// Ctrl up
input.ki.wVk = VK_LCONTROL;
SendInput(1, &input, sizeof(INPUT));
Sleep(50);
To simulate the CTRL+A just update this part to 'A'
// A down
input.ki.wVk = 'A';
SendInput(1, &input, sizeof(INPUT));
Sleep(50);
Again,
Thanks a lot for the help.
Ram.
|
|
|
|
|
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);
|
|
|
|
|