|
I have an application where I am attempting to set a socket option using "setsockopt." I want to set the KEEPALIVE feature to "ON."
The format is: setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &optval, sizeof(optval)); I am trying to detect if a socket is HUNG, or if a network wire has become disconnected. Some documentaion indicates that optval must be a pointer to a char but other places I have seen it should be an int. I cant seem to get it to work.
This code snippet will not work as some of the documentation seems to indicate:
*************************************
int value = 1; //ON
setsockopt(mysocket, SOL_SOCKET, SO_KEEPALIVE, &value, sizeof(value));
*************************************
Can someone tell me how to set up the KEEPALIVE feature.
Thanks.
Jerry
|
|
|
|
|
Hi!
I have a dialog based application with one modal dialog as an inserted dialog resource. The modal dialog is always displayed in the middle of the dialog based application. I would like to display it not in the middle but with given coordinates e.g. in the upper left corner of the screen. Can somebody help me?
Regards.
|
|
|
|
|
You can reposition the dialog by making a call to MoveWindow() or SetWindowPos() in the dialog's WM_INITDIALOG handler. Here's an example of how to position the dialog at the top left corner.
CRect rectDlg;
GetWindowRect (&rectDlg);
int nWidth = rectDlg.Width();
int nHeight = rectDlg.Height;
rectDlg.left = 0;
rectDlg.right = nWidth;
rectDlg.top = 0;
rectDlg.bottom = nHeight;
MoveWindow (&rectDlg);
- or -
SetWindowPos (NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
Call SetWindowPos() from the dialog's OnInitDialog() method.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
|
I am having an issue with my toolbars when changing themes in windows XP.
In the application I have several toolbar buttons that are inactive based on the settings the user has selected.
Under some themes, a greyed out button will be displayed as a grey box the full size of the button (looks nasty).
Under other themes, the greyed out button is a normal shadow of the colored part of the button (which is what I want).
I can get it to work under different themes, but it's a matter of going back and re-doing the background color of the toolbar. Then it will work under one, and not under others.
Am I doing somethign wrong?
Is there a 'standard' background color I am supposed to use?
I use VS C++ 6.0 and RougeWave Stingray toolkit.
I can hack my 256 color bitmaps down to 16 color and those work under all themes.. but of course.. they look awful.
(no clue why VS doesn't have a 256 color editor built in).
Thanks..
|
|
|
|
|
I have to admit that I have not used 256 colour toolbars with Stingray toolkit. Have you asked Roguewave support the same question? It sounds like their owner drawn toolbar is not coping with the theme change correctly.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
I have create some dynamic CEdit controls..
e.g...
CEdit newEdit; // as a member var of class in the header
newEdit.Create(WS_VISIBLE|ES_NUMBER|WS_DLGFRAME ,startRect,this,NULL);
...
What window style flags do I need to set so the CEdit looks like a standard CEdit that you get when adding to a dialog resource?
Thanks in advance
|
|
|
|
|
WS_VISIBLE|WS_BORDER
Jaime
|
|
|
|
|
Hi, how can I identify a carriage return (\n)using fscanf ?
Thanks,
Deepak Samuel.
|
|
|
|
|
It has an ascii value of decimal 13, eg.
if(nChar==13)AfxMessageBox("Carriage Return");
|
|
|
|
|
I am scanning the file for interger values what happens if my file itself contains a integer value of 13 ? How can I differentiate between my data and a carriage return?`
Thanks,
Deepak Samuel
|
|
|
|
|
Maybe you can tell by looking for CR, LF...at the end of each line.
|
|
|
|
|
Character 13 and number 13 are totally different things. When using fscanf() , you must tell it what type of data is being read. In other words:
char c;
fscanf(pFile, "%c", &c); This will not read the number 13 from the file. Likewise:
int n;
fscanf(pFile, "%d", &n); This will not read the character 13 from the file.
Make sense?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
i've to implement Gabor filter for feature extraction from an face image in VC++6 would any body help me?
|
|
|
|
|
Gabor filter ... ?!?!
is it the filter to find Zsa Zsa Gabor in an image ?!
seriously, any problem in particular or the whole algorithm ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
This[^] library will do it for you. It's compatible with VC6 and VC7.1.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi friends
I want to know whether my MONITOR is OFF or ON .. Is there any way for this ..
If u (knows) this
{
pls inform me;
}
else
{
}
Regards
Krishnadevan.K
my e-mail ID : krishnadevan@ushustech.com
If u can Dream.. U can do it..
|
|
|
|
|
I don't know of a way, but I'm curious why you'd need this type of information.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Just for knowing it can be possible .. and also its more FUN , yeah ?
If u can dream.... U can....
|
|
|
|
|
krishnadevank wrote:
...and also its more FUN , yeah ?
Yes, but only if there was a benefit in knowing such information. Since the display adapter does not care whether the monitor is actually on or off, finding a straight-forward API to tell such information is going to be hard to find, if at all.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I doubt that there is a way to detect this. How would you determine the difference between the monitor being without power and the monitor not being connected at all.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|
|
Thanks all for the Reply.. Leave the case when monitor is not connected.. Then , What about the standy by ? Is it possible ?.. (If possible i can run some programs when monitor is OFF )
Regards
Krishnadevan.K
IF u can Dream it ... U can do It.....
|
|
|
|
|
With regards to standby. This is governed by power management. I personally have no experience of power management on windows and therefore do not know any API calls that could be made. I would have thought that these do exist however.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Williams (Little Britain)
|
|
|
|