|
Hi,
We are using raw sockets with IPPROTO_ICMP. We are facing problem in Win2008. When the network cable of the server machine is removed then Winsock api Select( ) is returning wrong value.Due to that we are observing behavior difference in Win2003 and Win2008.
We have the following code in our application.
int bread;
SOCKET sockRaw;
sockRaw = WSASocket(
AF_INET,
SOCK_RAW,
IPPROTO_ICMP,
NULL, 0,0);
//All socket connection and initialization code
fd_set set = {1,{sockRaw}};
timeval timeValue = {TIMEOUT_PERIOD_SEC, 0};
bread = select(NULL,&set,NULL,&set,&timeValue
If we remove the network cable of the server application ie., network failure then bread is 0 in Win2003, 1 in Win2008 . Due to this we are observing a behavior difference in the application in a particular scenario. What needs to be done so that bread is 0 even in Win2008 in case of network failure.
Any help would be appreciated.
Thanks..
|
|
|
|
|
I have made a custom Button with text on the button.
I want to change the color of button, color of the text on the button and the border color on the button . I have to use CColorDialog to select the desired color.
Anyone know the way, how to do this?
|
|
|
|
|
Use the OnCtlColor [^] message handler.
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]
|
|
|
|
|
Hello, I am going to develop a service program. with VC.
can Anyone help me to start this work?
brief and useful articles that I can use they
thank you
Zo.Naderi-Iran
|
|
|
|
|
zon_cpp wrote: can Anyone help me to start this work?
brief and useful articles that I can use they
You could always try this[^].
|
|
|
|
|
See, for instance, here [^].
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]
|
|
|
|
|
|
|
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi
I have a class for stop/start service, and can give a sample.
Tell me(or call me if you like)
Hadi
www.logicsims.ir
|
|
|
|
|
Hello All,
I have received an assignment for Extracting data from the WebPages, still now I have learnt some basic thing like MFC and Win32 API.
Can anyone please suggest me topics which I have to learn before starting this assignment.
My Assignment is like for example we have an espn site schedules
http://espn.go.com/nfl/teams/schedule?team=dal
WK DATE OPPONENT RESULT W-L HI PASSING HI RUSHING HI RECEIVING
1 Sun, Sep 13 @ Tampa Bay W 34-21 1-0 Romo 353 Barber 79 Crayton 135
I have to extract the Schedule details like Team name, Date , Place etc … and store it to some table.
Please suggest me some good topics and sites.
Thanking you,
Naveen Hs.
|
|
|
|
|
See [^]. Moreover, have a look at these CP articles [^] (most of them are C# based, but presented techniques may be used as well with C++/MFC ).
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]
|
|
|
|
|
Thank you sir very much, i will go through the articles it will be very useful for me.
|
|
|
|
|
This has no sense at all.
You can do it with 10 lines of code with COM (or UDLTF)
|
|
|
|
|
kilt wrote: This has no sense at all.
You can do it with 10 lines of code with COM (or UDLTF)
Yes, and with 5 lines of WTF, I suppose.
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]
|
|
|
|
|
kilt wrote: You can do it with 10 lines of code
Interesting that all your responses are like this, except the actual number of line may be different, but you never post the actual code, or a link to where it may be found!
|
|
|
|
|
Then shouldn't you be really kind and post those 10 lines in a reply to the original poster, instead of whinging about people helping.
I think I've just been suckered into troll-feeding...
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
kilt wrote: This has no sense at all.
By seeing the kind of trash that you post here, it can be concluded that you have no sense at all.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
You could navigate the HTML with Microsoft's IHTMLDocument2 interface. The table you are interested in extracting from is the first <table> element on that page.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thank you very much for the reply David.
|
|
|
|
|
I have struggled with loading web page sources and parsing them too.
This is the way I prefer and it's the easiest one I know:
#include "afxinet.h"
...
BOOL GetPageSource(CString& url, CString& source){
CInternetSession ises;
CFile* file=new CFile();
try{
file=ises.OpenURL(url);
}
catch(CInternetException* e){
CString error=L"";
error.Format(L"Connection error!\nError code: %ld",e->m_dwError);
AfxMessageBox(error);
return FALSE;
}
UINT len=1024;
char buf[1024];
source=L"";
while(len>0){
len=file->Read(buf,1024);
if(len>0)source.Append(CString(buf),len);
}
file->Close();
ises.Close();
return TRUE;
}
You can use GetPageSource() function to get a page source.
For the parsing part, I use regex.
|
|
|
|
|
when i changed the main function of a template class into a separate file, i have got a link error.Display is a function in the template class
error LNK2001: unresolved external symbol "public: void __thiscall Gen_Queue<int>::Display(void)" (?Display@?$Gen_Queue@H@@QAEXXZ)
What may be the problem?
Anyone know the solution?
I was coding a generic queue. i have made GenericQueue.cpp with functions Add(), delete() and display(). genericQueue.h have the variables and declaration of the functions.
In another file GenericQueueMain.cpp i have written the function main() for the generic queue. I have made an object for the GenericQueue and tried to call the functions . Then i got the error-- error LNK2001: unresolved external symbol "public: void __thiscall Gen_Queue<int>::Display(void)" (?Display@?$Gen_Queue@H@@QAEXXZ)
modified on Tuesday, October 13, 2009 6:23 AM
|
|
|
|
|
What files? What is the 'main function' of a template file? What were the changes (i.e. There are chances you'll post the relevant code?)?
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]
|
|
|
|
|
Your question is not really clear but I guess you are trying to move the definition of a template class from a header file to a cpp file. Am I right ?
If that is the case, you can't do something like that. For a template class, the full definition of the class and functions has to be known when compiling, thus you have to include everything in the header file. One 'trick' to get around that problem is to move the definition in a .inl file (to differentiate from a standard cpp file) and include that file in your header file (at the bottom of the file).
|
|
|
|
|
hi.
i am writing a video processing application. at first i tried to use OpenCV and it was greate as it had very high performance. but i need to implement some functions by myself and i am doing this. but the main peroblem is the "performance". for example, i used the cvSub(...) funcation to subtract two 2D arrays. and then i tried to do this with a simple "for loop". the calculation times are shown below:
openCV : 0.135496 ms
mycode : 0.376614 ms
and i ran the program several times and the result was the same.
so i am here to ask :
do you have any idea for performing the task as fast as OpenCV?
part of my code :
double t2;
printf("-----cvSub on cvMat------\n");
for(int i=0; i<5; i++)
{
t2 = (double)cvGetTickCount();
cvSub(mat1, mat2, mat3, 0);
t2 = (double)cvGetTickCount() - t2;
printf( "detection time = %gms\n", t2/((double)cvGetTickFrequency()*1000.) );
}
printf("-----sub on 2D array------\n");
for(int i=0; i<5; i++)
{
t2 = (double)cvGetTickCount();
for(int j=0; j<240; j++)
{
for(int k=0; k<320; k++)
{
m3[j][k] = m1[j][k]-m2[j][k];
}
}
t2 = (double)cvGetTickCount() - t2;
printf( "detection time = %gms\n", t2/((double)cvGetTickFrequency()*1000.) );
}
each method is performed 5 times to get the mean time
|
|
|
|