Re: Application hang on exit?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"OldDog" <mikef2691@xxxxxxxxxxx> wrote in message
news:576feb74-e96b-4325-ab61-e7ec9f07fd02@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Dec 22 2008, 12:18 pm, "Linn Kubler" <lkub...@xxxxxxxxxxxxxxxxxx>
wrote:
Hi,

I have written a Visual FoxPro application to track my computer inventory.
I adopted WMI scripting calls to remotely get information about the CPU,
memory, NIC and hard drives from the computer in question. Works pretty
slick. However, I've found one quirk that I'd like to correct if I can.

Basically, if I query a computer then shut it down and exit my application
it hangs. It's like one of the connections to the computer needs to be
dropped by VFP before I shutdown the computer. Any idea how to rectify
this
issue?

Here is how I connect to the computer:
strNamespace = "root\cimv2"

objWbemLocator = CreateObject("WbemScripting.SWbemLocator")
THISFORM.objWMIService = ;
objwbemLocator.ConnectServer(strComputer, strNamespace, strUser,
ALLTRIM(THISFORM.Password))
THISFORM.objWMIService.Security_.authenticationLevel
=WbemAuthenticationLevelPktPrivacy

I've tried setting THISFORM.objWMIService = NULL but that doesn't work.

Beyond that I'm just doing a series of Select calls to the computer like
this:
THISFORM.colCompSystem = THISFORM.objWMIService.ExecQuery ("SELECT * FROM
Win32_ComputerSystem")THISFORM.colPhysicalMemory =
THISFORM.objWMIService.ExecQuery ("SELECT * FROM Win32_PhysicalMemory
WHERE
capacity > 16777216")

Any suggestions?

Thanks in advance,
Linn

Do you open Visual Fox Pro with your script? Do you shut Visual Fox
Pro down at the end?

No, at this point I'm still running my scripts in VFP in the development
mode. So I start VFP, do my development work and whatever including running
this script multiple times. Then by the end of the day I will close down
VFP.

The work-around I've found is to make sure I exit the form that runs these
scripts right after performing the inventory. That way I'm assured that the
computer will still be on.

I eventually want this to be part of a larger maintenance and monitoring
program so I would like to figure out what I need to do to release this
without having to close my application.

Thanks,
Linn


.



Relevant Pages

  • Re: Problem creating VFP COM object in IIS on Win 2003 64 bit server
    ... the IIS manager as well as from script. ... VFP front end to retrieve procedures and things to do from the server then ... Runtime VFP files are on a Server 2003 and the dll has been ...
    (microsoft.public.fox.programmer.exchange)
  • Converting WMI Script to VFP?
    ... I'm playing around with Windows scripting with an eye towards making my own ... fine when run as a VBS file but when I run it from VFP I get an error. ... running this from a Windows VPC system if that matters. ... works as a VBS script from this same VPC system. ...
    (microsoft.public.fox.programmer.exchange)
  • Trying to implement a script?
    ... The script lists details about the network card in a computer. ... For Each IPConfig in IPConfigSet ... FOR EACH objNIC IN colNICSettings ... When I run this program it totally crashes VFP. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: VFP 7, Is there a way to test if a table can be opened EXCL without using ON ERROR
    ... (actually I believe the entire VFP session is ended) ... opens its files. ... If Script 1 calls Script 2, ... instance of VFP and when a script ends, the instance of VFP that was needed ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Daily/weekly/monthly output aggregation
    ... > Since I'm not an experienced sysadmin yet (have installed fbsd a week ago ... > Saturday ready to configure for development work) I don't know why you'd ... There's a difference between the system output, and your own script outputs. ...
    (freebsd-isp)