INetwork.GetName catastrophic failure

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
DataLife
Posts: 447
Joined: 29 Sep 2013, 19:52

INetwork.GetName catastrophic failure

13 Jan 2018, 15:41

Can someone tell me how to eliminate this catastrophic failure error or at least suppress it?

Suppressing should be ok because when I click YES to continue my script still works as expected.

I tried to add the screenshot to this post but the preview does not show it. So I added a link to the image below.
Image

https://www.dropbox.com/s/w6nurv70hkrg5 ... r.PNG?dl=0

Here is the code that is causing the catastrophic failure.

Code: Select all

ActiveNetwork =   ;if the pc is not connected to any network then  ActiveNetwork := INetwork.GetName() is skipped,
  for INetwork in ComObjCreate("{DCB00C01-570F-4A9B-8D69-199FDBA5723B}").GetNetworks(1)
   ActiveNetwork := INetwork.GetName()
  if ActiveNetwork =
   return
Check out my scripts. (MyIpChanger) (ClipBoard Manager) (SavePictureAs)
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: INetwork.GetName catastrophic failure

13 Jan 2018, 17:28

use try

Code: Select all

ActiveNetwork =   ;if the pc is not connected to any network then  ActiveNetwork := INetwork.GetName() is skipped,
  for INetwork in ComObjCreate("{DCB00C01-570F-4A9B-8D69-199FDBA5723B}").GetNetworks(1)
   try ActiveNetwork := INetwork.GetName()
  if ActiveNetwork =
   return
User avatar
DataLife
Posts: 447
Joined: 29 Sep 2013, 19:52

Re: INetwork.GetName catastrophic failure

13 Jan 2018, 17:47

thanks HotKeyIt, I will try

Code: Select all

 try ActiveNetwork := INetwork.GetName()


I never was able to reproduce the error on command, I just have to wait and see if comes back.
Check out my scripts. (MyIpChanger) (ClipBoard Manager) (SavePictureAs)
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.
User avatar
DataLife
Posts: 447
Joined: 29 Sep 2013, 19:52

Re: INetwork.GetName catastrophic failure

18 Jan 2018, 01:40

Thanks HotKeyIt, using "Try" has resolved the catastrophic failure error.

I have a very unusual issue with retrieving the network name.

With the code below I am monitoring the network name (windstream) which is the name of my wireless network.
It returns windstream until I open Devices and Printers and click Add Printer. While scanning for a new printer the network name changes to DIRECT-EIDESKTOP-V3D3LUJPHRW

I have no idea what (DIRECT-EIDESKTOP-V3D3LUJPHRW) is. DESKTOP-V3D3LUJ is my computer name.

This only happens on my PC running windows 10. I tried it on 2 other computers running windows 10 with no issues.

Why would scanning for a new printer cause the network name to change? Once the Add Printer dialog windows is closed the this script detects windstream again.

Code: Select all

loop
 {
  for INetwork in ComObjCreate("{DCB00C01-570F-4A9B-8D69-199FDBA5723B}").GetNetworks(1)
   try ActiveNetwork := INetwork.GetName()
  if ActiveNetwork <> windstream
   MsgBox %activenetwork%
  sleep 1000  
}

escape::
exitapp
Check out my scripts. (MyIpChanger) (ClipBoard Manager) (SavePictureAs)
All my scripts are tested on Windows 10, AutoHotkey 32 bit Ansi unless otherwise stated.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 206 guests