Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > Application hang on exit?

Reply
Thread Tools Display Modes

Application hang on exit?

 
 
Linn Kubler
Guest
Posts: n/a

 
      12-22-2008
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_.authenticationLev el
=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


 
Reply With Quote
 
 
 
 
Linn Kubler
Guest
Posts: n/a

 
      01-22-2009

"OldDog" <> wrote in message
news:576feb74-e96b-4325-ab61-...
On Dec 22 2008, 12:18 pm, "Linn Kubler" <lkub...@chartwellwisc2.com>
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_.authenticationLev el
> =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


 
Reply With Quote
Reply

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application Hang JSmith Internet Explorer 3 01-16-2009 07:58 PM
prevhost.exe - Fatal Application Exit - Could not open a file mapp Chris Windows Vista General Discussion 0 04-02-2007 05:24 PM
IE7 exit (close application) command missing in Full Screen mode Andrea Internet Explorer 1 02-20-2006 11:39 AM
application error on exit hlavender Internet Explorer 0 02-06-2006 09:37 PM
MSN Messenger 7.0777 at W2K: Application Error on Exit Wouter Windows MSN Messenger 1 04-07-2005 09:16 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59