Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-06-2004, 04:16 AM
Member
 
Join Date: Sep 2003
Posts: 95
Default .exe causes an illegal operation when attempting to access TCP/IP details

If there is nothing there (i.e. TCP/IP has been removed from the Network section of the computer), the following code breaks and the executable crashes.

Putting TCP/IP back in fixes the problem it seems.

Is there an error check that could be put in to prevent this?

Cheers.


//create a new Inet object to access the network configuration of the computer, if there is any set up
var inet = new Inet();

//ic: the network configuration of the computer
var ic = inet.getIPConfig();

//netsettings: gets set if any extra network settings are detected
var netsettings = false;

//check each network interface, and if one or more exist that are not just the local loopback, ask the user if they are sure about continuing.
for (i = 0; i < ic.ifNum; i++) {
var ip = ic.ifIP(i);
if ((ip.toString() != '127.0.0.1') && (ip.toString() != '0.0.0.0') && (ip.toString().indexOf('169.254.') != 0)){
netsettings = true;
}
}
Reply With Quote
  #2 (permalink)  
Old 01-07-2004, 02:09 AM
Junior Member
 
Join Date: Feb 2003
Posts: 12
Default Re:.exe causes an illegal operation when attempting to access TCP/IP details

you can check the object for validity before attempting to use it.

Code:
//create a new Inet object to access the network configuration of the computer, if there is any set up
var inet = new Inet();

if (!inet=="undefined"){

    //ic: the network configuration of the computer
    var ic = inet.getIPConfig();

    //netsettings: gets set if any extra network settings are detected
    var netsettings = false;

    //check each network interface, and if one or more exist that are not just the local loopback, ask the user if they are sure about continuing.
    for (i = 0; i < ic.ifNum; i++) {
       var ip = ic.ifIP(i);
       if ((ip.toString() != '127.0.0.1') && (ip.toString() != '0.0.0.0') && (ip.toString().indexOf('169.254.') != 0)){
          netsettings = true;
       }
    }
}
else{
    //do something here if the inet object couldn't be created.
}
Actually suprised that you are running into machines that don't use IP in some fashion.

-Umpa
Reply With Quote
  #3 (permalink)  
Old 01-07-2004, 09:41 PM
Member
 
Join Date: Sep 2003
Posts: 95
Default Re:.exe causes an illegal operation when attempting to access TCP/IP details

yeah i know, tell me about it....

cheers, will look into that.
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:47 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.