000
25.03.2004, 14:11 Uhr
RedEagle
|
Habe mir nen code runtergeladen, der Prüfen soll, ob man mit dem Internet verbundn ist, aber beim Compilieren kommen imma 2 Linker Errors. Was mache ich falsch?? bzw: was fehlt??
| Code: |
[Linker error] undefined reference to `RasEnumConnectionsA@12' [Linker error] undefined reference to `RasGetConnectStatusA@8'
|
| C++: |
#include <windows.h> #include <ras.h> #include <iostream> using namespace std;
bool CheckForConnection() { RASCONN RasCon; LPRASCONN pRasCon = &RasCon;
RASCONNSTATUS RasConStatus;
DWORD lpcb; DWORD lpcConnections; bool ReturnValue;
pRasCon->dwSize = 412; lpcb = 256 * pRasCon->dwSize; ReturnValue = false;
if(RasEnumConnections(pRasCon, &lpcb, &lpcConnections) == 0) { RasConStatus.dwSize = 160; RasGetConnectStatus(pRasCon->hrasconn, &RasConStatus); ReturnValue = (RasConStatus.rasconnstate == 0x2000); }
return(ReturnValue); }
// Beispiel:
int main() { if(CheckForConnection()) { cout << "Connected to the Internet !"; } else { cout << "Not connected to the Internet !"; } }
|
-- MFG RedEagle |