|
priyanka s wrote: print in list box
m_listbox.AddString();
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I am continusely getting this error i am just fed up now,do u have any idea how to come out of this,
Any idea any kind of header to b included,and change in declration,I have tried AddString(); but the same error
<br />
:\myproject\wartz\wartzDlg.cpp(313) : error C2039: 'm_hWnd' : is not a member of 'CString'<br />
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'<br />
C:\myproject\wartz\wartzDlg.cpp(313) : error C2039: 'Printf' : is not a member of 'CString'<br />
c:\program files\microsoft visual studio\vc98\mfc\include\afx.h(368) : see declaration of 'CString'<br />
XListBox.cpp<br />
Clipboard.cpp<br />
Generating Code...<br />
Error executing cl.exe.<br />
Creating browse info file...<br />
<br />
wartz.exe - 2 error(s), 0 warning(s)<br />
|
|
|
|
|
I think that rather than creating a control variable for the CListBox you have associated a CString variable by the name m_list1 to it.Can you just check for this in the header file of your dialog.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
thanks your idea has done a good job for me,
|
|
|
|
|
Try this if m_Log is control variable
#define LOG \
if (::IsWindow(m_Log.m_hWnd)) \
m_Log.InsertString // Use Insert String
void CWartzDlg::Onconnect()
{
CString login= m_arielapi.Login("wwtest2","RD9234","wwtest2");
CString serveradd=m_arielapi.GetServerAddress(login);
BOOL bSuccess=FALSE;
for(int n=0;n<3;n++)
{
if(login)
{
bSuccess=TRUE;
break;
}
}
if(bSuccess)
{
CString cstrDispData;
cstrDispData.Format(_T("==>Connected to server[%s]"),serveradd);
LOG(0,cstrDisplayData);
}
}
Regards
Amar
-- modified at 1:52 Thursday 10th August, 2006
|
|
|
|
|
I have no words to say u thank you....its working
By this method i am printing single ,single variable,suppose if i want to print the whole string
that is comming from server ie marketno,tradetype,clientref,price etchow to do that,is there any function for that.
-- modified at 12:18 Thursday 10th August, 2006
|
|
|
|
|
You can use also m_ListBox.InsertString
|
|
|
|
|
I have a list of 60 non-identical Chinese names (MBCS build). I am trying to create a routine that will count how many non-identical names there are. Simple I thought, use the STL set which is a unique list. Thing is, using those 60 Chinese names, the resulting set size is 58. It has discarded 2 names for no reason. OK, maybe a set is not up to the challenge, so I instead used the vector class. A vector of 60 names, sort() and unique() again becomes 58.
Unless anybody can point me in the right direction, I'm going to have to create something of my own.
std::vector< std::string > names(sheet->UsedRows() );
std::set< std::string > list;
short col = -1;
for (int i=0;i<sheet->UsedCols();i++) {
if (head[i].type == NAME)
col = head[i].column;
}
if (col == -1)
return 0;
for (i=xRow;i<sheet->UsedRows();i++) {
names[i] = sheet->Cell(col,i);
list.insert( sheet->Cell(col,i) );
}
int sz = names.size();
sort(names.begin(),names.end() );
names.erase( unique(names.begin(),names.end() ),names.end() );
int foo = list.size();
int bar = names.size();
|
|
|
|
|
I doubt this has anything to do with the STL, or at least, not specific containers. For some reason, the algorithm used to detect what is unique is failing. Perhaps if you wrote your own algorithm and called it using foreach ? Or at least work out which items are disappearing, then step into the code to work out why.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
To go along with that Christian said, start with a smaller set of names (say, 10 known unique names) to test the algorithm you are using (or that unique is using in this case). Also, instead of removing the names, try printing them first to see if the ones being removed are the same ones each time.
As a side note ...
waldermort wrote: std::set< std::string > list;
This is bad practice. Avoid naming variables the same as typenames for standard types.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
I do not understand why this is happening, however the following functions work for small numbers of data, but for larger numbers (ie 100,000 to 1,000,000) I get a stack overflow. These are protected functions of the class "Sample." Sample has a one dimensional dynamically allocated array of doubles pointed to by the m_data variable.
Any help would be appreciated because I have not been able to find a solution to this
Thanks
<br />
void Sample::quicksort(signed long int top, signed long int bottom){<br />
signed int long middle;<br />
if (top < bottom){<br />
middle = partition(top, bottom);<br />
quicksort(top, middle);<br />
quicksort(middle+1, bottom);<br />
}<br />
return;<br />
}<br />
<br />
<br />
signed long int Sample::partition(signed long int top, signed long int bottom){<br />
double x = *(m_data + top);<br />
signed long int i = top - 1;<br />
signed long int j = bottom + 1;<br />
double temp;<br />
do{<br />
do{<br />
j--;<br />
}while (x > *(m_data+j));<br />
<br />
do{<br />
i++;<br />
}while (x < *(m_data+i));<br />
if (i < j){<br />
temp = *(m_data+i);<br />
*(m_data+i) = *(m_data+j);<br />
*(m_data+j) = temp;<br />
}<br />
}while (i < j); <br />
return j;
}<br />
|
|
|
|
|
You have recursive function calls. Every time a recursive function is called, the state of the caller is pushed onto the stack so it can be popped off the stack when the called function returns in order to restore the state. You are simply running out of stack space as a result.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Ok. Why would that happen after a sort size of 3000 for instance????
|
|
|
|
|
Any recursive function can cause a stack overflow if it recurses too often.
JKallen wrote: signed int long middle;
Is this legal ? It's certainly redundant. Variables are signed by default, and long and int are the same, so long would have done. Why is it there, this can't be C, it's a class. You've created a variable before it needs to exist ( and when sometimes it does not ), and not given it a default value. This is very poor form.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
It is legal. It is only redundant on a per compiler basis. long signed int specifies for all compilers where some platforms may default to short as the old C++ compilers do,..etc. the definition is fine. in fact I changed the "ints" to short signed unsigned lnog etc,...no difference. The problem is that I am running out of stack,...what i dont get is why this happenes sorting 3000 items.
|
|
|
|
|
JKallen wrote: It is only redundant on a per compiler basis.
Yes, it's true that the standard only sets minimum sizes for variable types, a long may be bigger than an int. But I don't see how 'long' wouldn't work everywhere ?
JKallen wrote: in fact I changed the "ints" to short signed unsigned lnog etc,...no difference
I know that, I was making a general comment about the efficiency and cleanness of the code.
JKallen wrote: The problem is that I am running out of stack,...what i dont get is why this happenes sorting 3000 items.
Obviously because each call is placing two more calls on the stack, and you're running out.
What if you add a counter to the code, a static variable or something ? Perhaps the loop is running for more often than it needs to, and there's a bug in the partition code ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
So. Is the message you cannot sort more than 3000 items using a quick sort algorithm? Is there a way around this limitation? ie is there a way to manage the recursive calls dynamically?
|
|
|
|
|
JKallen wrote: Is the message you cannot sort more than 3000 items using a quick sort algorithm?
No, the message is that apparently you can't do that using this particular implimentation.
JKallen wrote: ie is there a way to manage the recursive calls dynamically?
Not that I know of. I believe you can change your stack size, but this is a poor solution IMO.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
I've not ever seen top/bottom used with quicksort. I use left/right. That aside...
The reason for the endless recursion is that top is always LT bottom . See if this helps:
void Sample::quicksort( int top, int bottom )
{
if (top < bottom)
{
int nMiddle = partition(top, bottom);
quicksort(top, nMiddle<code> - 1</code>);
quicksort(nMiddle + 1, bottom);
}
}
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
If you are familiar with xcacls.exe (provided by Microsoft) it lets you view the NTFS access control lists for a directory. However, it only lists global (AD) security groups and doesn't know how to resolve local security groups. Example : SERVERNAME\Local_Group_01
When right clicking a folder in Windows Explorer, both local AND global groups are displayed properly.
Before I start on this and hit a potential roadblock, does anyone know if GetExplicitEntriesFromAcl ([^]will return detail about the local security groups that might be included in an ACL?
|
|
|
|
|
hopr u mentioned about cacls.exe and not xcacls.exe. cacls list both local sids and domain sids. tahts how it works. alternatively u can use GetExplicitEntriesFromAcl as well. I donno why it displays only domain sids in ur case?
cheers..Milton Kb
|
|
|
|
|
Can someone help me my problem?
How can do i compare two images?? what i need is just a simple comparison... E.g. After both images are being compared, a message will say either "correct" or "wrong" that's all....
Thanks,
Best Regards....
|
|
|
|
|
You can load them into a DC and use GetPixel, but it's much faster if you can make them a DIBSEction, and then you can access the image data as a byte array and compare it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|