|
I've the following problem:
the client invokes some functions on the server side, which takes a lot of time (a few minutes) to answer. I believe it depends on the timeout. How can I put it up?
I've the following exception:
"Caught exception:
Type: class RCF::Exception
What: [30: client read timed out][0: No sub system][0: ][What: ][Context: ..\rcf-09c\src\rcf\TcpClientTransport.cpp(275): void __thiscall RCF::TcpClientTransport::bsdRecv(const class RCF::ByteBuffer &,__w64 unsigned int): : Thread-id=688 : Timestamp(ms)=41594734: THROW : class RCF::Exception : [30: client read timed out][0: No sub system][0: ][What: ][Context: ]: bytesToRead=4,..."
Many thanks,
Daria
|
|
|
|
|
Does anyone know of a C++ equivalent (preferably *not* MFC) of .Net's FileSystemWatcher?
[edit] never mind, after a bit more searching, I stumbled upon this [^][/edit]
Last modified: 12mins after originally posted --
|
|
|
|
|
Hi
I'm getting streaming data to the program I'm writing and I need to update the data constantly. I'm currently just doing a switch statement to determine what needs to be updated and then after the switch I have UpdateData(false); This works but it will not allow me to enter values into over boxes in the display as it is constantly being updated. Is there a way to update just the single box value and not the whole display?
Thanks
Simon
|
|
|
|
|
simoncoul wrote: Is there a way to update just the single box value and not the whole display?
Sure, just use ClassWizard (Ctrl+W) to assign a control variable to each control on the dialog. For edit, static, and button controls, use SetWindowText() . For listboxes and comboboxes, use AddString() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hey thanks for the quick reply, but the SetWindowText asks for a LPCTSTR as the argument but I need to do integers and sometimes floats. Can I just cast it?
Thanks again
|
|
|
|
|
There are functions for appropriate conversion, for example itoa, ltoa.
Or, if you are using CString:
long var =12345;
CString strVar;
strVar.Format( "%d", var );
MS
|
|
|
|
|
simoncoul wrote: Can I just cast it?
No. Use:
char szData[16];
int nValue = 12345;
sprintf(szData, "%d", nValue);
...
double dValue = 987.01;
sprintf(szData, "%f", dValue); By chance are you using MFC?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes I am, does that make this easier?
|
|
|
|
|
simoncoul wrote: does that make this easier?
Not necessarily easier, but slightly more elegant and efficient:
CString strData;
int nValue = 12345;
strData.Format("%d", nValue);
...
double dValue = 987.01;
strData.Format("%f", dValue);
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for all the help guys!
|
|
|
|
|
simoncoul wrote: Can I just cast it?
No.
There is a routine you cann add to yotu program called boost::lexical_cast[^] which allows you to use a simple cast.
(The documentation even describes what is going on under the hood)
double pi = 3.14;
std::string number = boost::lexical_cast<std::string>( pi);
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
can anybody tell me how to read the data from a .cvs file to an array
|
|
|
|
|
use CStdioFile to read the text lines from the file and strtok to split and extract each value from the text line.
|
|
|
|
|
Would you be so kind as to tell us what a .cvs file is? Short of that, the best you could hope for would be a rather vague solution.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
a ".cvs" file is a comma sepereated values file(.CSV). The file is comma delimited. You can store data such as Justin, James, Perez and save the file, and load it into Excel and it will put them into a table for you.
Or maybe you were being sarcastic
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
Of course I know what a .csv file is! My question pertained to .cvs files.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I assumed it was a typo by the OP. Jokes on me a guess
I get all the news I need from the weather report - Paul Simon (from "The Only Living Boy in New York")
|
|
|
|
|
csv stand for Comma seperated value
|
|
|
|
|
philiptabraham wrote: csv stand for Comma seperated value
I'm more than aware of that.
In any case, how are you wanting to read said file?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I am trying to maintain an old program that uses
///////
RECT rc;
GetWindowRect(&rc);
MoveWindow (rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top);
ScreenTo Client (&rc);
m_buttonDisable.Create("Disable",WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_DISABLED,
CRect(rc.left+360+horizBtnOffset,rc.top+35+vertBtnOffset,
rc.left+430+horizBtnOffset,rc.top+65+vertBtnOffset), this, IDC_BUTTON_DISABLE);
///////
to draw Group Boxes around similarly created buttons.
It all works fine if the desktop theme is set for "Windows Classic" but if another theme (e.g. Windows XP) is selected, the thicker title bar obscures part of the text. I do not want to re-write the code as it is much more complex than the snippet shown. What I would like to do is detect the Windows desktop theme and adjust the "vertBtnOffset" to move the label.
Is this possible?
If so can you give me a guiding light?
Thanks for any help.
|
|
|
|
|
cgb143 wrote: What I would like to do is detect the Windows desktop theme...
Can you look here:
HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\LastTheme
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks for your response, unfortunately I don't understand it.
Is this in the registry?
How do I access if from within my program?
|
|
|
|
|
cgb143 wrote: Is this in the registry?
Yes.
cgb143 wrote: How do I access if from within my program?
With the registry API.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
I am trying the following code and getting link errors
#include "stdafx.h"<br />
#include "HttpClient.h"<br />
#include "Wininet.h" <br />
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#endif<br />
<br />
<br />
CWinApp theApp;<br />
using namespace std;<br />
int main(void)<br />
{ int nRetCode = 0;<br />
HINTERNET hInternet;<br />
char *appName = "My App";<br />
<br />
hInternet = InternetOpen(appName,<br />
INTERNET_OPEN_TYPE_DIRECT,<br />
NULL,<br />
NULL,<br />
INTERNET_FLAG_ASYNC<br />
);<br />
<br />
return nRetCode;<br />
} And Errors I am Getting is as follows:
HttpClient error LNK2019: unresolved external symbol __imp__InternetOpenA@20 referenced in function _main
HttpClient fatal error LNK1120: 1 unresolved externals
I dont know what is going worng. Plase HELP ME
|
|
|
|
|
You forgot to link Wininet.lib .
Prasad
MS MVP - VC++
|
|
|
|