|
sahoong wrote: For further explanation or clarification, please, mail me to olaskg@yahoo.ie.
Are you nuts? This is a forum for you to ask/answer questions. We don't go looking for you! Post your question. Be as exact as possible. Include only relevant code snippets.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
We have too feeble minds to comprehend him. I bet he's laughing at us right now.
--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören
|
|
|
|
|
For a client application, after sending a string to the server,
I want to receive 2 strings from the server separately.
But the second recv() call quite often receive NULL.
How can I solve this problem?
(give a delay for it is sometimes better, but NOT always work)
Thanks!
|
|
|
|
|
Receive NULL returned from recv or NULL for number of bytes received?
1) Make sure both strings get sent.
2) Make sure you wait for both strings to get to the client.
You'll need to poll or wait for an FD_READ event/notification from the socket
and REPEAT until you've received the number of bytes you are expecting.
TCP knows nothing about "strings". It only knows a stream of bytes.
It is up to you to know how many bytes to send and receive and to reassemble them into "strings",
"packets", etc. on the receiving end.
Mark
|
|
|
|
|
After receiving the first string, the buffer is cleared (set '\0' to all indices).
After the second recv(), the buffer is still all '\0'.
I am sure that the server has sent 2 strings to the application (client).
The condition is that the second recv() sometimes can receive the correct string, but often receives NULL.
recv() holds the application progress.
Once it finished, the application can go on.
It returned BOOL TRUE so it succeeded but actually nothing is received......
Please help.
Thanks.
|
|
|
|
|
can you post the code you use to send and the code you use to receive?
What is the return value from recv()? Is it the number of bytes sent? Less than that?
Is it 0?
Mark
|
|
|
|
|
Mark,
I do NOT have the code now.
I post it ~8 hr later.
Thanks for your help!
|
|
|
|
|
<br />
Remote PC Socket -----------> Local PC Socket<br />
|<br />
|<br />
Between them Read Data by my Local Prog<br />
<br />
<br />
Remote PC Socket <----------- Local PC Socket<br />
|<br />
|<br />
Between them Read Data by my Local Prog<br />
This is like a send/receive data reader on local machine read all TCP/UDP/...etc data on any Port. i.e. Network Protocol Analyzer
How I can Implement this? Which Protocol should be used for this?
|
|
|
|
|
|
I created a tab ctrl derived from CTabCtrl.
I want to change the border style,so I paint it myself.
But I find that if xp theme enabled,
my tabctrl doesn't have a yellow header on the top of the item.
Infact ,I like the yellow header.
Is there any way that I can onwer draw a tab ctrl,and there is a yellow header if xp theme enabled?
Thank you
|
|
|
|
|
Tricky.. To get the "XP feel" you'd have to use the theme API to draw the tab, but then you'd have to paint your borders after you have drawn the tab with the theme API. Make sure to test your UI with several themes though, to make sure that your additions are general enough, so that it doesn't look bad when using other themes (or no themes for that matter).
There are a bunch of theme API articles on Codeproject if you need specific help on how to program it. Also make sure to lookup the Theme Explorer article here, as it'll help you ALOT to find out what state/part combination draws what.
Good luck!
--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören
|
|
|
|
|
I am going to develop a automatic windows service which continuously moniters for devices connected to USB drive.. and i need to get type of device connected to usb port(ex:keyboard or mem stick etc...). What are the functions in windows API to do above things?
Thanks in advance..
|
|
|
|
|
Take a look at the SetupDiEnumDeviceInterfaces() function
#include
InterfaceClassGuid = GUID_DEVCLASS_USB
Mark
|
|
|
|
|
I am going to develop a automatic windows service which continuously moniters for devices connected to USB .. and i need to get type of device connected to usb port(ex:keyboard or mem stick etc...). What are the functions in windows API to do above things?
Thanks in advance..
|
|
|
|
|
Have you looked at HKLM\SYSTEM\CurrentControlSet\Enum\USB and HKLM\SYSTEM\CurrentControlSet\Enum\USBSTOR keys? The LocationInformation value is indicative of what the device is.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Take a look at the SetupDiEnumDeviceInterfaces() function
#include <devguid.h>
InterfaceClassGuid = GUID_DEVCLASS_USB
Mark
|
|
|
|
|
Is this[^] helpful for you
|
|
|
|
|
Hi ,
I have created edit boxes using the following
vector<cricheditctrl*>RichEditBox;
CRichEditCtrl *r1 = new CRichEditCtrl;
r1->Create(WS_CHILD|WS_VISIBLE|ES_AUTOVSCROLL,
CRect(x1,y1,x2,y2), p, 1);
r1->SetEventMask(ENM_CHANGE | ENM_SELCHANGE );
RichEditBox.push_back(r1);
With the above code I get empty CRichEditboxes on the current window.Now I want to navigate through these boxes with Up Down arrow keys.
What should I do ?
Please help
Prithaa
|
|
|
|
|
what's a vectorRichEditBox ?
|
|
|
|
|
I think he forgot to check ignore the html tags option.
He should be having vector<CRichEditCtrl*> RichEditBox
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
vector<CRichEditCtrl *>RichEditBox;
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
normally I would only use the TAB ( and the tab order ) to navigate a series of controls like that.
BUT
you could override the ON_CHAR ( ? ) and handle the down and up key to call either NextDlgCtrl PrevDlgCtrl .
You will need to set the ordering manually, which I'm not certain on how to do it.
|
|
|
|
|
Hi,
in my vc++ application i need to import a dll. I did by the statement
#import"test.dll"
but it is giving compilation error as
fatal error C1083: Cannot open type library file: 'test.dll': No
such file or directory
Cany any one help me how to resolve this issue
Thanks
bollapalli
|
|
|
|