|
I got 1231 error value when using the code below.
1231: The network location cannot be reached. For information about network troubleshooting, see Windows Help.
my lan and internet is working fine.
then where is actually the problem residing.
HANDLE hIcmpFile;
unsigned long ipaddr = INADDR_NONE;
DWORD dwRetVal = 0;
char SendData[] = "Data Buffer";
LPVOID ReplyBuffer = NULL;
DWORD ReplySize = 0;
ipaddr = inet_addr((const char*)m_sAddress);
ReplySize = sizeof(ICMP_ECHO_REPLY) + sizeof(SendData) +1;
ReplyBuffer = (VOID*)malloc(ReplySize);
hIcmpFile = IcmpCreateFile();
if (hIcmpFile == INVALID_HANDLE_VALUE)
{
return -1;
}
dwRetVal = IcmpSendEcho(hIcmpFile, ipaddr, SendData, sizeof(SendData) + sizeof(ICMP_ECHO_REPLY), NULL, ReplyBuffer, ReplySize, 500);
if(dwRetVal != 0)
{
PICMP_ECHO_REPLY pEchoReply = (PICMP_ECHO_REPLY)ReplyBuffer;
struct in_addr ReplyAddr;
ReplyAddr.S_un.S_addr = pEchoReply->Address;
m_sMessage.Format(_T("Received from %s Status = %ld RoundTripTime = %ld"), inet_ntoa(ReplyAddr), pEchoReply->Status, pEchoReply->RoundTripTime);
return 0;
}
Future Lies in Present.
Manmohan Bishnoi
|
|
|
|
|
If you want to use ping from your application, have a look at boost::asio. Boost have a ping example program that you may be able to adopt. Note that your application requires administrative privileges on Vista to create ICMP packets.
Regards,
Sternocera
|
|
|
|
|
Manmohan29 wrote: I got 1231 error value when using the code below.
From GetLastError() ?
"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
|
|
|
|
|
yes
Future Lies in Present.
Manmohan Bishnoi
|
|
|
|
|
Do you get that error for all addresses?
"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
|
|
|
|
|
yes same for all IP's.
My OS is Windows Seven RC.
I have also tested this on XP. There also the problem is same.
Future Lies in Present.
Manmohan Bishnoi
|
|
|
|
|
I suggest you try others examples from 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
|
|
|
|
|
How to plug/unplug USB serial port problematically?
I am facing some strange issue with my USB serial port.
I want to unplug and plug the USB Serial port Programitically, as i need to refresh the connection between system and hardware connected.Kindly help.......
Thank in advance for the great programmers
|
|
|
|
|
pallaka wrote: I want to unplug and plug the USB Serial port Programitically, as i need to refresh the connection between system and hardware connected.
You cannot do that from user mode. You must ask the driver for that functionality if it supports it at all, which I doubt when it comes to serial port drivers for USB.
pallaka wrote: I am facing some strange issue with my USB serial port.
Perhaps you can elaborate on what the "strange issue" is all about.
It's quite possible that there is another solution than resetting the port/device.
What have you done so far and what problems are you facing that you want to solve by resetting the port?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Hi All,
I have a basic question , i have a dialog based application and in the App class we create an object for the dialog class and do DoModal()in InitInstance() of the App class ..
Can anyone tell me when Run the Application How the InitInstance will get called or the other of calls made which calls the App classes InitInstance()
Thanks,
Hari
|
|
|
|
|
There's a very easy way to check that: put a breakpoint in the function and start your debugger. Once the breakpoint is hit, take a look at the callstack.
|
|
|
|
|
I tried it and it says AfxWinMain() can anybody explain in detail and thks for the quick reply.
|
|
|
|
|
Hari_16 wrote: can anybody explain in detail
See here[^]. It's an old article but I think it will already give you valuable information.
|
|
|
|
|
Hari_16 wrote: Who calls InitInstance()?
God.
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]
|
|
|
|
|
CPallini wrote: Hari_16 wrote:
Who calls InitInstance()?
God.
I realize now why he's so busy these days....
Most problems in the world that some people are waiting for God to solve will remain due to all his calls to InitInstance() ....
Revolutionary - I've never thought of it that way before!
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Roger Stoltz wrote: Most problems in the world that some people are waiting for God to solve will remain due to all his calls to InitInstance()....
However, as balance, there are all the missed problems due to the lack of God's intervention...
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]
|
|
|
|
|
hi,
i want to modify the return value of a file query.
i tried to achieve it by modifying the IRP_MJ_QUERY_INFORMATION in FileStandardInformation.
but it doesn't work, someone can help me?
thank you soooooooo much!!
modified on Tuesday, October 27, 2009 7:22 AM
|
|
|
|
|
Hi All,
Need car motion simulator supporting directional control with ramp up/down facilities.
Do appreciate a plain text explanation for subject related physics algorithms.
Thanks.
|
|
|
|
|
What is your exact question ? Are you looking for a physics engine ? If yes, take a look at Newton Physics Engine[^]
|
|
|
|
|
I'm not looking for a physics engine, what I'm looking for is simple car shape that can move forward and backward along with left/right turn functionality and as well as ramp climbing option.
It is highly appreciated if the above mentioned motions formulas can be explained.
|
|
|
|
|
katres wrote: It is highly appreciated if the above mentioned motions formulas can be explained.
Well, they actually are explained: in physics books.
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]
|
|
|
|
|
I want to write a class that creates its own device context (dc) and provide function to draw line between two points. This class should provide function CopyDC(srcDC, destDC); This class should be an independent class (should not be derived from any other class) so that i could use this class in any other project later.
i have no idea how to do this in MFC dialogs. Please help me....
K. Masood
|
|
|
|
|
If you need a full graph (not only a simple line), you can take a look at my signature. I developped such a charting control and it could be useful for you.
|
|
|
|
|
Hi,
Im going to develop a new application.
Till now im using VC6.0 for my previous application. But now i want to create the application looking very glossy Office 2007 window style and more glossy colors in windows.
Actually my doubt is Can i do this in VC6.0 or is it easy to do in VC2008.
I have this 2 option.Im confused to choose one.
Because im well experiened in vc6.0 and i have whether i get this styles in vc6.
So please help me.What platform shoud i go for?
And also i want one more thing.For my applicaiton,it should be like:
Only toolbars will invoke while starting the applicaiton,it will go on to the top of our desktop,from the menu in toolbar i will switch to diferent window.this window has close and minimize buttons.
I know im little bit boring,but i need this help from u all experienced people.
Anu
|
|
|
|
|
i think VS 2008 is better since, it is very easy to create the office style with VS 2008
Величие не Бога может быть недооценена.
|
|
|
|