|
Yes, without duplicating the socket.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thanks for your answer!!!
Gajendra
|
|
|
|
|
5 .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I am trying to delete all items of a CListBox
However, only the top item is removed once calling this routine, How do I delete everything ?
Thanks
<br />
numOfItems= listBox.GetCount();<br />
<br />
for (int i =0; i<=numOfItems; i++){<br />
lisBox.DeleteString(i);<br />
}<br />
llp00na
|
|
|
|
|
CListBox::ResetContent[^].
Btw there's also a fundamantal flaw in your method. Consider what your loop does:
1. i becomes 0, the very first ("zeroth") item is deleted from your list, this will raise all other items 1 place, so 0 goes away, 1st becomes the 0th, 2nd becomes 1st, 3rd becomes 2nd and so on...
2. i now becomes 1, the 1st item in your list is deleted, and the ones under it jump up one place, so the 0th item is untouched, the 1st is deleted, 2nd becomes 1st, 3->2, 4->3 ...
3. i now becomes 2, 2nd item is deleted, so 0th is untouched, 1st is untouched, 2nd is deleted, 3rd becomes 2bd, 4->3 and so on...
Get the problem?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Great answer
Thanks for the clarification. Looks like i can not think anymore
llp00na
|
|
|
|
|
Yourwelcome.
If you want to stick to the for loop, try movings in reverse, so something like:
for (int I = Count - 1; I >= 0; I--)
listbox.DeleteString(I);
or simply do this:
for (int I = 0; I < Count; I++)
listbox.DeleteString(0);
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Awesome ideas
Thanks
llp00na
|
|
|
|
|
use this:
m_listBox.resetContent();
Thanks
Surya
|
|
|
|
|
Hi all,
I am working on VC 2008, suddenly my project has started giving an error
error C2039: 'SetDlgItemText' : is not a member of '`global namespace''
1>
error C3861: 'SetDlgItemText': identifier not found
but when i complie same program on any other system on which vc 2008 is installed it don't give any error and compiles successfully....
Please anybody can help me in removing this problem..
Thanks in advance
|
|
|
|
|
You probably don't have the platform SDK installed on one of the machine. I don't know if it still the case for VC2008, but for VC2005, if you downloaded the free version, you had to download yourself the platform SDK (the platform SDK contains all win32 core functionalities).
|
|
|
|
|
both machine has licenced version of visual studio installed
|
|
|
|
|
In that case, have a look at the C++ project directories (Tools->Options->Projects and Solutions->VC++ Directories) and check that the Windows SDK include directory is in your include path.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
these 4 directories are present over there
$(VCInstallDir)include
$(VCInstallDir)atlmfc\include
$(WindowsSdkDir)\include
$(FrameworkSDKDir)include
|
|
|
|
|
Mmmmm - $(WindowsSdkDir)\include is the one that contains WinUser.h , which contains SetDlgItemText (well, actually SetDlgItemTextA and SetDlgItemTextW ).
Soooo - guess the first thing you could try is cleaning your build and rebuilding it (maybe the pre-compiled header's got itself confused?), then the next thing you could try is running your .cpp file that doesn't compile through the C pre-processor (use cl -P or set the relevant options in your project settings) on your machine and also a machine where it does build and check for differences between the pre-processor output - the definition of SetDlgItemText obviously isn't getting through the pre-processor to the compiler.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I seem to remember running into this a few years ago, but I don't remember the specifics.
Have you googled it? My guess is that you haven't.
EDIT - It may have had something to do with the CFormView...
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi There.
I have a Dialog based Application: Title "ABC Application"
I want to launch this appiication and then want to set an edit box available on this window with some text.
This is what I am doing right now.
ShellExecute(NULL, L"open", L"C:\\Program Files\\ABC.exe", NULL, NULL, SW_SHOWNORMAL);
HWND WndOST2PST = NULL;
WndOST2PST = ::FindWindow(NULL,L"ABC Application");
if(WndOST2PST == NULL)
return false;
SendMessage(WndOST2PST, WM_DESTROY, 0, 0);
I am not able to get handle of that specific edit control. Please provide some pointers for the same.
Thanks
PanB
|
|
|
|
|
hi,you'd better get the window handle from one variable.
the dialog title may be not right in this course.
|
|
|
|
|
you can do this by EnumChildWindows API. See the See the sample snippet[^]
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Try this
CString Text;
CWnd *pWnd = FindWindow(NULL, "Title");
CWnd *pChildWnd = pWnd->GetWindow(GW_CHILD);
while(pChildWnd)
{
UINT uiID = pChildWnd->GetDlgCtrlID();
pChildWnd->GetDlgItemText(uiID, Text);
pChildWnd->SetDlgItemText(uiID, "Test");
pWnd->SendMessage(WM_COMMAND, MAKEWPARAM(uiID, BN_CLICKED), (LPARAM)pChildWnd->m_hWnd);
pChildWnd = pChildWnd->GetWindow(GW_HWNDNEXT);
}
|
|
|
|
|
Use this to set data into text box
SendMessage(_Edithwnd, WM_SETTEXT, 0, (LPARAM)strCaption);
|
|
|
|
|
Hello to all,
i need to read a RTF file via iostream and convert it internally into plain text. The plain text should be searched for some keywords ... and the text between these keywords should be stored into an other (different) file.
The problem is not to read the RTF via iostream.
The problem is to skip all these formatting instructions of the RTF, because i need only the plain text.
Solving that, i need some code snippet ... but i haven't found something like that.
Additionally, the code should not use COM, DCOM, Automation of MS Word or somthing like that. Just a peace of C++ code.
Anybody out there ... having an idea how-to or look-where ???
Thank's for any idea.
|
|
|
|
|
This article[^] is in C#, but probably covers the basics so you could write a C++ version
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
In my application I am having dialog .I am receiving images from mobile and I am displaying Images on dialog. I have added vertical scroll bar to dialog.I am creating 8 static controls programatically on dialog and I am using these 8 static controls for Image display. At a time I am displaying 8 Images on Dialog.I am using Scroll bar to display all Images. I have written following code in my "displayImage" function.for every scroll I am calling this function.
for(int i = 0; i < 8; i++)
{
if((i != 0)&&(i%4 == 0))
{
x1 = 1;
x2 = 250;
y1 = y1+355;
y2 = y2+355;
}
myStatic[i] = new CStatic();
myStatic[i]->Create(_T(""),WS_CHILD|WS_VISIBLE|SS_BITMAP,
CRect(x1,y1,x2,y2),this);
image.Load(Image);
HBITMAP hbmp = image.Detach();
if(hbmp == NULL)
{
Error = GetLastError();
}
if(hbmp != NULL)
myStatic[i]->SetBitmap(hbmp);
}
First 8 Images are displaying Properly.After that If I scroll Scroll Bar dialog is showing first 8 Images first and It is displaying second 8 images.If I scroll third time it is showing first 16 images after that it is showing third 8 images and so on.Can anyone help me.
|
|
|
|
|
Probably your data structure is not getting cleared and still holds the images that you displayed earlier. Debug to check
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|