|
You can also split your buffer and send them step by step.
A. Riazi
|
|
|
|
|
Hi,
If u are using TCP connection the size is limited to 1480 bytes and similarly UDP buff size is fixed (don't remember exactly). So, it is always better to split buffer and send them.
|
|
|
|
|
i'm trickering a thread from another thread, from the old thread i give the SOCKET towards the new thread as a parameter. in the new thread i make a connection with a class for the functions of the thread, now i'm able to send data from my thread to my class, but i have no idear how to send a command from my class toward an other thread(to send data to de client SOCKET). so, how can i send data from the Class towards my Thread(to send the data to another computer)??
<br />
Server Thread ==> Client Thread(receive data) ==> Class CConnection<br />
Class CConnection ==> Client Thread(send data)<br />
<br />
Server Thread: UINT ServerThread(LPVOID Param<small>((LPVOID)this)</small>)<br />
Client Thread: UINT ClientThreadRecv(LPVOID Client<small>(socket)</small>)<br />
Client Thread: UINT ClientThreadSend(LPVOID Client<small>(socket)</small>)
|
|
|
|
|
Use PostThreadMessage in your class to post a message to your thread and GetMessage in your thread to get message posted by class.
A. Riazi
|
|
|
|
|
Hi world...
I wondered how a program (or a DLL) created by a company can send a bugs report remotely (for example by email)?
I want to do that...
Can somebody direct me towards the best solution?
Thanks in advance...
... Union makes force!
Hello World!!!
from Raphaël
|
|
|
|
|
1. Sockets. Socket server must be running and open to internet.
2. FTP. Dump an error report file into predefined directory on your company’s FTP side.
3. HTTP (with SOAP or without). In simple terms just invoke some WEB page on your company's server
|
|
|
|
|
You can find related article on CP.
A. Riazi
|
|
|
|
|
|
Or maybe a little bit more work by the original poster. People need to learn how to search for answers on their own.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Tim Smith wrote:
Or maybe a little bit more work by the original poster. People need to learn how to search for answers on their own.
Amen
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Yup, too.
Holy Sh*t! I'm speechless. (hey, that's a first) Marc Clifton, The Lounge
|
|
|
|
|
I am in the midst of developing an application that I'd like to be able to minimize to the system tray. I understand how to add an icon to the System Tray, and I understand how to make a window's button disappear from the task bar. What I don't understand is how to both remove the status bar button and show the icon when the window is minimized.
Is there an appropriate OnMinimize() method for CWnd? Maybe I'm just thinking too hard about this, but I cannot see how one can tie the minimize action to the two things I want to do. Any ideas?
Jonah Bishop
Visit JGB Productions
|
|
|
|
|
Do you mean Task bar button or Status bar button?
A. Riazi
|
|
|
|
|
I said "status bar" button but meant the "task bar" button. I can already add an icon to the system tray, and I know how to make the task bar button disappear. But I don't know how to connect these two items to the user's minimizing the application.
From what someone else replied, I think the WM_SYSCOMMAND is what I want, but I won't be able to try it until I get home from work...
Jonah Bishop
Visit JGB Productions
|
|
|
|
|
|
Search for articles on this site which talk about the System Tray, such as this[^] one.
For handling the Minimize event, check out the WM_SYSCOMMAND message.
Regards,
Alvaro
All you need in this life is ignorance and confidence, and then success is sure. -- Mark Twain
|
|
|
|
|
Well, in my old project where I was using #import and a database class, I see that I had Yu "stdafx.h" replaced with YX in my project settings C++ tab. My new project has Yu in it and it wont compile but if I change it to YX it works. I must have done this in the earlier project but cant remember (if I even knew it) why and what it means....Please help. I am afraid if I make this Yu change and get my new prog to run, I might get in trouble later on in the project....
Appreciate your help,
ns
|
|
|
|
|
Do you have MSDN installed? There is good description search for "/Yu" and "/YX".
I would not recommend using "/YX" without full understanding of what it does.
|
|
|
|
|
See my prev. post on compile issue
|
|
|
|
|
I selected "automatic use of precompiled headers' and yu changed to yx, and its happy now. hope its okay....have to read about yx yet..thanks for the response
Appreciate your help,
ns
|
|
|
|
|
HI ,
This is what i'm doing :
OnButtonClick event ,I spawn a thread and while the thread is executing i just want to change the mouse cursor to busy...Is it possible??
InitDialog()
{
hBusyCursor = LoadStandCursor(IDC_WAIT);
hOldCursor = ::GetCursor();
}
MyClass::OnButton1()
{
::SetCursor(hBusyCursor);
AfxBeginThread(runThread,this);
}
UINT MyClass::runThread(LPVOID param)
{
((MyClass *)param)-run();
return 0;
}
void MyClass::run()
{
::SetCursor(hBusyCursor);
// do some thing;
::SetCursor(hOldCursor);
return;
}
//
But the cursor never changes.. Why so??
Could anyone help me .. Thanks very much.
|
|
|
|
|
Use must use thread communication between your class and thread.
before using AfxBeginThread() change your mouse cursor to IDC_WAIT, then when thread goes to finished, send a message to class (by using ::SendMessage() .
In message handler, change cursor to IDC_NORMAL.
A. Riazi
|
|
|
|
|
Hi!!
Thanks for your reply..
I tried as you told .
One thing i observerd was- Irrespective of thread spawning and all that --
If you change the cursor from within OnButtonClick(), then once the OnButton1() function is exited the cursor is automatically reset to Normal Cursor.
SO Generally.. Is there any way to set the Cursor globally throughout .. (i.e) on a Button click or some other control's event , the cursor change remains valid throught the rest of the execution..
THanks so much..
|
|
|
|
|
define a member variable with variable type CWaitCursor to your dialog class. Use member function of CWaitCursor for changing mouse cursor.
A. Riazi
|
|
|
|
|
I added adox ccp and .h and dbclass cpp and .h to my project (these work in another project)., But even after rebuilding all I get:
C:\DbClass.cpp(1540) : fatal error C1010: unexpected end of file while looking for precompiled header directive
AdoX.cpp
C:\AdoX.cpp(794) : fatal error C1010: unexpected end of file while looking for precompiled header directive
What am I doing wrong?
Appreciate your help,
ns
|
|
|
|