|
Why cannot anyone help me?
- Anthony Chen
|
|
|
|
|
You need to pass the Socket handle to the thread that you want to
use to terminate the thread that is waiting on it.
Use the "Thread Parameter" or other way.
When you close the socket from a different thread, the thread
that was waiting on "accept(...)" will return INVALID_SOCKET, so you will
know that if fail.
Hope this information helps
- Greatest invention : "The Microchip!"
|
|
|
|
|
If I understand well, you want a thread to tell a second thread to stop waiting on a socket, and you don't know how to do that because the second thread is blocking on the socket call?
If this is your problem, make the second thread use select() [See MSDN for complete description] to see if the socket is ready.
If i am right, and want more information, just tell me
Michel
|
|
|
|
|
Yeah, you are absolutely right! what you say is what i really mean.
i have checked the MSDN about select(), which is used to determine
the status of one or more sockets.
now would you mind telling me:
1. what should i do to terminate a thread which has been blocked on a socket saftly.
2. what should i do to terminate a thread which has a socket (no blocking) saftly.
thanks a lot. hoping more help.
- Anthony Chen
|
|
|
|
|
Hi Guys,
Is it possible to change the Dialog Border Style ???
Best Regards
Sonu
|
|
|
|
|
Use ModifyStyle/ModifyStyleEx
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Uh hello, i have to program an application which uses an access database. I started in Visual C++ but suddenly i remembered Visual Studio also offered Foxpro. Allthough i have no idea what you can use Foxpro for exactly i know it has something to do with databases... Should i use Foxpro for my application instead?
Kuniva
--------------------------------------------
God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.
|
|
|
|
|
Stick with Access.
I think they've abandoned Foxpro now
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I personally like Foxpro, but i'm not huge into DB programming but haven't heard much of Foxpro lately, so you should probably take the advice of Nish.
God gave man a penis and a brain but not enough blood to make both of 'em work at the same time.
You are who i got that quote from...god thats been bothering me for a while now.
Finally an excuse for all of MAN kind...
"An expert is someone who has made all the mistakes in thier field" - Niels Bohr
|
|
|
|
|
FoxPro is very good for writing applications that interact with databases, that is it's primary function. The latest version 7, (just out recently) is pretty impressive with support for COM and Active X and XML. There is no .NET support yet but it is promised.
Michael
|
|
|
|
|
Hi, all you happy coders
I Hope somebody can help me with this problem I am having:
In my program i try to allocate about 500KB (in smaller pieces) with the new operator,
but it hangs in some function called '__sbh_alloc_block'...
Is this because I can't get more memory from windows...?
Thanks in advance,
Erik Hammar
|
|
|
|
|
Erik Hammar wrote:
i try to allocate about 500KB (in smaller pieces)
From that sentence I assume you have a loop of some kind where you repeatedly call new till you get 500 KB is several smaller blocks [or so we assume]
Now are you sure your loop is looping the right number of times. perhaps it's a sort of endless loop!
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
No it's not a loop...
I create instances of about 5 classes, which each allocate one or two blocks of memory...
|
|
|
|
|
After how many sucessful 'new's do you get the error?
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
I get it after 5 times...
...
byte *bmpdata = new byte[256*240];
memsize 1 > 128KB
class1 = new CClass1(memsize1)
(inside CClass1's constructor)
data = new byte[memsize1]
memsize 2 > 128KB
class2 = new CClass2(memsize2)
(inside CClass2's constructor)
data = new byte[memsize2]
class3 = new CClass3 - this is where it crashes (before the actual constructor of CClass3)
...
Seems really strange to me, that this hangs the program, and not only gives me a NULL pointer!
|
|
|
|
|
Well I cant even make any guesses from that.
But try creating the CClass3 object first and then create CClass1 and CClass2. Now if it still gives an error when you create the CClass3 the problem must be with something you are doing in the CClass3 constructor, but if the trouble happens with the third new then we are again nowhere
Try this out anyway. And if possible post the CClass1/2/3 constructor code as well. Also how is the data member-variable defined in these classes?
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Strange... moving the class3 creation code to the top, seems to eliminate the problem. That's strange, because the class3 doesn't even touch the class1 and class2
Anyway, Thanks for your concern!
|
|
|
|
|
Erik,
I think you should not be complacent about the error being removed. We still don't know why it crashed before. A bug that has been hidden but not removed can be very deadly.
Good luck.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
how can i make an instance of a CRecordSet class execute a more complex query (for example one with an inner select, as shown below)
e.g.
select name, street
from Customers
where name not in
(select name from Uninteresting_Customers
where ....)
the m_strFilter attribute off the CRecordSet class doesn't accept the more complex queries, quite obviously because it was only intended to contain the where-clause of the query....any help would be greatly appreciated...
bye
Jonas
|
|
|
|
|
I think for this case you should use ADO API functions:
check these:
http://lnrpc2.irb.hr/ebooks/0672313502/ch04/ch04.htm
http://lnrpc2.irb.hr/ebooks/0672313502/ch06/ch06.htm
|
|
|
|
|
Howdy,
I have a SDI CListView type app. I am using a WM_TIMER to try and update the list every second. The timer is working fine but the problem is that the list control doesn't update unless I click on one of the rows.. when I click on a row every row updates like it should, but when ever I want a update I have to click a row. Any ideas?
Rob
|
|
|
|
|
If you click and it updates itself i would assume you could get away with calling the CListView's SetFocus in your WM_TIMER. Although this might cause flicker and wouldn't allow you select any other object so this is only a short term fix. Perhaps a call to it's OnPaint or Invalidate() would be more appropriate.
If someone explains precisely why, please let me know!
TIA
"An expert is someone who has made all the mistakes in thier field" - Niels Bohr
|
|
|
|
|
Put an UpdateWindow after you update the list control. Though I am not sure you are doing the smart thing by calling a proc every 1 second using a timer.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
UpdateWindow() ,SetRedraw(TRUE), Update(), UpdateData(FLASE) RedrawWindow(), UpdateItems(int start, int end).. None of these work..
Nish [BusterBoy] wrote:
Though I am not sure you are doing the smart thing by calling a proc every 1 second using a timer.
My OnTimer just sends a WM_COPYDATA to another application in return that application sends my console updated data and I update the list control if there are any changes to be made.. So really, it only updates every now and then.. I know its not working because I can make a change in the other app and its not reflected in my Console until I click on a item in the list..
Dumb question, I can populate the list and do all the redrawing through my CListView class right?
Im a little new with SDI and MDI apps..
Thanks,
Rob
|
|
|
|
|
Dear all,
Is there any site available for All type of API functions,
and how can we know the recently developed API functions.
If any one knows please help me
Is there any Specific API is available to catch the recently added file in a Particular folder?
thank u.
anju
|
|
|
|