|
Hey madan tats gud.I did this same thing few years back, anyways enjoy.
|
|
|
|
|
Hi all,
I'm having an application for Remote control, but there are some problems in its part of network connections.I have tried for weeks, still can't find out the reason for that.
In our program, we don't use thread synchronization in function "TCPSock->Recv"(winsock api recv() is used in it), because this function is only used in single thread. Today, I tried to add thread synchronization to this function.As a result, these network connections problems are fixed(at least it seems to be).
My question is, "Is thread synchronization needed when only using a function in single thread?"
Regards,
HQ
|
|
|
|
|
hanq_38910130 wrote: "Is thread synchronization needed when only using a function in single thread?"
It is actually the other way round. If you are using multiple threads, then you try to synchronize access to the code that must be protected from multiple simultaneous accesses.
Or is that you are referring to an additional worker thread (other than the application's main thread) while saying a "Single thread"?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks for your replay
Yes, I mean "an additional worker thread" when I say "a single thread".
Our program mainly has two parts, server and client.
server accepts connections from client, when a connection is accepted, it creates a "worker thread" to communicate with the client. Only in this thread, "TCPSock->Recv()" will be called, so originally we don't use a "Thread Synchronization". But today, I Added "Thread Synchronization", and the bugs seem to be fixed, so I want to know "Is Thread Synchronization needed in single thread in some conditions?"
Thanks very much
|
|
|
|
|
hanq_38910130 wrote: But today, I Added "Thread Synchronization", and the bugs seem to be fixed
Glad about that.
hanq_38910130 wrote: "Is Thread Synchronization needed in single thread in some conditions?"
But, I still am not able to understand this. If it is just one thread accessing the code that must be 'protected', then it does not matter how many other threads are running simultaneously. But if more than one thread can possibly access the code that must be protected, then you need synchronization. I hope I am clear.
There is a whole lot of information on this topic here[^] if you would like to read up.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Thanks for your help.
I will look into the linking which you provided to see if there can be any useful information.
Add maybe the reason that causes all these problems exist in some other code, anyway I will check this.
|
|
|
|
|
Hi...
[ImageProcessing]My doubt is how to extract text from the image..before extraction we need to segment properly....
|
|
|
|
|
Stop spamming the site with your meaningless posts.
Read the guidelines[^] before posting anything more.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
|
Hello,
class CRICH : CRichEditCtrl
{
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
};
I have 5 CRICH boxes on CMDIChildWnd which are shown properly with a cursor in the first box . That is it has focus but once if I press a mouse cursor on the box the cursor disappears and none of the boxes has focus.If I click the mouse on the box LButtonDown message handler is not called.
What must be the problem ? thanks
Prithaa
|
|
|
|
|
For that we Need to set Focus for the 2nd box once i u have pressed enter..n u should monitor the window properly
|
|
|
|
|
Use the SetFocus Function & handle properly..
|
|
|
|
|
Hello,
Thanks
When 5 boxes appear on the window and I move the mouse on the box the cursor should change from arrow cursor to text type line cursor but the cursor type doesnt change.
Pritha
|
|
|
|
|
see first you write down all what needs to be done. Don't keep on adding requirements.
|
|
|
|
|
Hello,
Thanks for your reply.
I am not adding to my requirements .I am just saying that the cursor type doesnt cange hence I am not able to handle the mouse LButtonDown message. If it had changed than I would have been able to handle the mouse messages.
Prithaa
|
|
|
|
|
what is that you have done to change the cursor type?
|
|
|
|
|
Hello,
thansk for your reply.
I have done nothing to change the type but I thought since when the mouse goes on the box the arrow point automatically changes to text type pointer.
But somewhere I feel the box is not identified by the mouse .
prithaa
|
|
|
|
|
i don't think what you need will automatically happen. you are not setting the cursor. you are setting the focus to the editbox. you can always hide the cursor but AFAIK changing the cursor to text type pointer is not possible
|
|
|
|
|
Hello
thanks for all your replies . I ll look into it and take your advice
Pritha
|
|
|
|
|
Your Welcome and Please let me know if you could change the cursor to text pointer.
|
|
|
|
|
i want to make audio tuning wizard in MFC can anyone can please tell me about it.I have no idea of it.
thanx in advance.
|
|
|
|
|
Read the guidelines[^]
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
step 1: do some research so that you atleast have some idea of it
step 2: write alot of code
step 3: profit!
|
|
|
|
|
Hello Guys,
I was wondering, is it possible to rotate controls like text boxes or buttons in a specific dialog, or even rotating the whole dialog? What I am trying to do is making a windows mobile application, that has a button, when you press this button, the whole dialog - with its contents - should rotate by 90 degrees, or in other words become in landscape view, the problem is, I don't want to rotate the whole OS, I know that I can change the orientation of the device, but that will be very slow and won't be a good solution.
I have found some samples here in there that rotate a label or picture box, but not more complex controls or a whole dialog, I followed the steps to rotate a label or picture box to rotate a button or text box, but they didn't work out, and I don't know why.
Thank you in advance and I appreciate any suggestions.
|
|
|
|
|
lemonade_81 wrote: I followed the steps to rotate a label or picture box to rotate a button or text box, but they didn't work out
Why? Can you tell us a bit more about your attempts?
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]
|
|
|
|