|
Look at the back of your computer. The network card/interface usually has 2 LEDs. One usually means "connected", the other one indicates traffic. If both LEDs are dark, you most probably have a faulty network card.
If you have at least one steady light, you should fire up a command line ("cmd.exe") and display the IP configuration ("ipconfig"). Find your LAN-connection. Look at the IP-Address:
If the IP-address is in the range of 169.254.0.1 to 169.254.255.254 and the Subnet-Mask is 255.255.0.0:
Chances are your (Windows-)computer is configured to obtain an IP-address automatically, but could not reach the DHCP-Server. You are then not in the same network as any computer with a DHCP-assigned IP.
If the IP-address matches one of the following descriptions
10.*.*.*
192.168.*.*
172.16.*.* to 172.31.*.*
you probably have received an IP-address from an DHCP-server, which usually indicates that you are connected to a network.
If you seem to be connected to a network, examine the "Standard Gateway": If this is set to an address in your network, you probably have a problem with a firewall or router blocking your network traffic. If this is set to "nothing", DHCP configuration may have failed.
If everything seems to be ok this far, try pinging a known server in your network by IP-address and by hostname. If the ping at the address is successful, but pinging the hostname fails, your network's DNS-server (if any) might be botched up.
Try issuing "release" and/or "renew" commands with IP-Config (for the correct syntax, see "ipconfig /?".
For more info, try "http://www.windowsnetworking.com[^], http://support.microsoft.com/kb/164015[^], http://www.microsoft.com/technet/network/evaluate/technol/tcpipfund/tcpipfund_ch16.mspx[^], http://support.microsoft.com/kb/172218[^] and the Online Book "TCP/IP Fundamentals"[^].
Cheers,
Sebastian
--
Contra vim mortem non est medicamen in hortem.
|
|
|
|
|
Look at the pre-last post at this page:
http://www.codeguru.com/forum/archive/index.php/t-103765.html
It contains the function you need.
-------------------------
Don't worry, be happy )
|
|
|
|
|
That function works? hmmm I have my doubts
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
It worked a bit ago, when I used it for some project...
Win32 contained a function named [CODE]IsInternetConnection()[/CODE], but I can't find in MSDN. Strange.
-------------------------
Don't worry, be happy )
|
|
|
|
|
It probably works but I don't believe it accurately indicated whether a machine is connected to
the internet though....maybe on a specifically configured network...
Actally I just reread it - in the context of dialup maybe it's ok. On a LAN though, I
don't think so.
I was just sceptical, that's all
The OP's question to me is petty vague. Does he want to know if there's a network adapter, if
the cable's plugged in, is there internet access...
Cheers!
Mark
"Great job, team. Head back to base for debriefing and cocktails."
(Spottswoode "Team America")
|
|
|
|
|
You're right (to some extent).
If you're accessing internet through NAT/router, you won't get correct results.
But function works ok for direct connection... that was the question, I guess
Best regards,
Dmitry.
-------------------------
Don't worry, be happy )
|
|
|
|
|
Hi all,
I have the following class, with structure and function:
class CIniFile
{
public:
struct Record
{
string Comments;
char Commented;
string Section;
string Key;
string Value;
};
static vector<Record> GetSection(string SectionName, string FileName);
So now I call the function:
vector<CIniFile::Record> s = CIniFile::GetSection("Client Files",IniFileName);
My question is how can convert s to a string ?? Or is there another way of getting it to a string or char*.
Many Thanx
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Programm3r wrote: My question is how can convert s to a string ??
Can you explain a little clearer ?
Do you want to know , how to access members of Record in the class ?
|
|
|
|
|
prasad_som wrote: Do you want to know , how to access members of Record in the class ?
Yes, but I think I solved the problem thanx prasad_som....
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Programm3r wrote: problem
|
|
|
|
|
|
|
It seems like I forgot to export the function in the other dll (in the def file), but it's working now ....
Thanx anyway
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Do you mean , this function is in dll and you are using it ?
You need to link its .lib in to client lib,. Have you dont this ?
|
|
|
|
|
Yes, I have already link the lib file. It's actually one dll calling another, but in the one dll I forgot to export one of the functions. When I changed the dll so that it exports the function everything seems to be working. But thanx alot for your input prasad.
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
|
Possibley you are deleting corrupted memory. Actually, call stack should show you where it is occuring.
|
|
|
|
|
The exception occurs right before my dll terminates ... the debugger refered to assert , would this make a difference?
Debug Assertion Failed!
File: dbgheap.c
Line: 1252
Expression: _CrtIsValidHeapPointer(pUserData)
For more information see the VS C++ Documentation on assert
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Again same, its is dues to corrupting memory. One typical example would be,
char *p = new char[10];
strcpy(p,"string greater than 10");
delete []p;
or
char *p = new char[10];
delete []p;
delete []p somewhere from program.
|
|
|
|
|
Ok, nowhere in my program am I using the delete nor ZeroMemory functions. I'll do some serious debugging, but thanx Prasad.
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Programm3r wrote: program am I using the delete nor ZeroMemory functions.
Doesn't matter. It could be possible , that memory created on stack(array) is corrupted this way.
|
|
|
|
|
Thanx anyway Prasad ... this bug is starting to p^ss me off ... but oh well .. I'll figure it out ..
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Hi all,
How could I clear / erase the contents of s :
class CIniFile
{
public:
struct Record
{
string Comments;
char Commented;
string Section;
string Key;
string Value;
};
vector<CIniFile::Record> s = CIniFile::GetSection("Client Files",IniFileName);
I tried the following:
s.erase(s.begin(),s.end());
Bit receive the following:
Windows has triggered a breakpoint in CompClientApp.exe.
This may be due to a corruption of the heap, and indicates a bug in CompClientApp.exe or any of the DLLs it has loaded.
The output window may have more diagnostic information
Many thanx
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r My Blog: ^_^
|
|
|
|
|
Its object, not pointer, isn't it ?
|
|
|
|
|