Click here to Skip to main content
15,904,351 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generalhelp with making a web browser Pin
Zinzara17-Mar-05 8:17
Zinzara17-Mar-05 8:17 
GeneralRe: help with making a web browser Pin
Zinzara18-Mar-05 4:40
Zinzara18-Mar-05 4:40 
GeneralRe: help with making a web browser Pin
Dr_Lomax18-Mar-05 4:48
Dr_Lomax18-Mar-05 4:48 
Questiontextbox to loop? Pin
Makniteasy17-Mar-05 7:24
Makniteasy17-Mar-05 7:24 
AnswerRe: textbox to loop? Pin
Robert Rohde17-Mar-05 10:05
Robert Rohde17-Mar-05 10:05 
GeneralSending messages from one app to another app Pin
j1webb17-Mar-05 6:27
j1webb17-Mar-05 6:27 
GeneralDial the Net Automatically Pin
Member 180980717-Mar-05 4:53
Member 180980717-Mar-05 4:53 
QuestionDisplaying a Variable? Pin
pn199517-Mar-05 2:58
pn199517-Mar-05 2:58 
Hi I am trying to call a Function from a Sub routine that basically does a WMI check and puts the results into a Variable.

Then from the main Sub routine Display the variable in the HTA app.

I'm sure the WMI function works ok but I'll be damed if I can get the variables to be displayed in the HTA app.

Here is a sample of the code Iam running, any help would be appreciated. Thanks

' ********* GET OS FUNCTION **********

Function GatherInformation
On Error Resume Next

Set objWMIService = GetObject("winmgmts:\\" & sComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM win32_OperatingSystem", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems

strOperatingSystem_InstallDate = objItem.InstallDate
strOperatingSystem_Caption = objItem.Caption
strOperatingSystem_ServicePack = objItem.CSDVersion
strOperatingSystem_WindowsDirectory = objItem.WindowsDirectory
strHTML = strHTML & objItem.Caption
strHTML = strHTML & strOperatingSystem_Caption

Next
Set objWMIService = Nothing
GatherInformation = True
DataArea.InnerHTML = strHTML
End Function



' ********* END OS FUNCTION **********


' ******* PUT HTML IN THERE ***

Sub Display
strHTML = strHTML & strOperatingSystem_Caption & "hello"
DataArea.InnerHTML = strHTML
End Sub
' ********************************


' ********* Main Subroutine ***********
Sub MainSub
On Error Resume Next

DataArea.InnerHTML= " "
sComputer = ComputerTextBox.Value
If sComputer = Empty Then
strHTML = strHTML & "Please Enter a Computer Name "
DataArea.InnerHTML = strHTML

Else
If IsConnectible(sComputer,"","") Then
strHTML = strHTML & "Ping Successful"
If WMIPing(sComputer) Then

strHTML = strHTML & strOperatingSystem_Caption & "hello"
strHTML = strHTML & "WMI Connection Successful" & "
"
Call GatherInformation



Set objWMIService = Nothing
GatherInformation = True
strHTML = strHTML & strOperatingSystem_Caption & "hello"
DataArea.InnerHTML = strHTML


Else
strHTML = strHTML & "WMI Connection Fail"
End If
Else
strHTML = strHTML & "Ping Fail"

End If
DataArea.InnerHTML = strHTML
End If

End Sub
AnswerRe: Displaying a Variable? [EDITED] Pin
Dave Kreskowiak17-Mar-05 4:57
mveDave Kreskowiak17-Mar-05 4:57 
GeneralRe: Displaying a Variable? [EDITED] Pin
pn199517-Mar-05 5:18
pn199517-Mar-05 5:18 
Generala record delete problem Pin
Anonymous17-Mar-05 0:13
Anonymous17-Mar-05 0:13 
GeneralRe: a record delete problem Pin
Sebastien Lachance17-Mar-05 6:57
Sebastien Lachance17-Mar-05 6:57 
GeneralWindows 2000 Server Pin
ga051016-Mar-05 4:38
sussga051016-Mar-05 4:38 
Generalreading a .txt file for data in VB .NET Pin
bizjosh16-Mar-05 2:17
bizjosh16-Mar-05 2:17 
GeneralRe: reading a .txt file for data in VB .NET Pin
Christian Graus16-Mar-05 15:38
protectorChristian Graus16-Mar-05 15:38 
GeneralRe: reading a .txt file for data in VB .NET Pin
Dr_Lomax18-Mar-05 4:59
Dr_Lomax18-Mar-05 4:59 
GeneralRe: reading a .txt file for data in VB .NET Pin
j1webb18-Mar-05 12:13
j1webb18-Mar-05 12:13 
QuestionDo you know why its happened? Pin
Mohamed Ishak15-Mar-05 23:59
professionalMohamed Ishak15-Mar-05 23:59 
GeneralPropertyGrid - Internet Explorer hosting problem Pin
Member 88279715-Mar-05 19:11
Member 88279715-Mar-05 19:11 
GeneralRe: PropertyGrid - Internet Explorer hosting problem Pin
Member 88279717-Mar-05 20:21
Member 88279717-Mar-05 20:21 
GeneralCrossWord puzzle alogrithm Pin
Mohsen Saad15-Mar-05 18:06
Mohsen Saad15-Mar-05 18:06 
GeneralRe: CrossWord puzzle alogrithm Pin
Colin Angus Mackay16-Mar-05 0:14
Colin Angus Mackay16-Mar-05 0:14 
GeneralCrystal Report:The LoadSaveReportException: Load Report Error Pin
Bing Chen15-Mar-05 10:41
Bing Chen15-Mar-05 10:41 
QuestionHow to send info out the lpt port????? Pin
mjvone15-Mar-05 10:09
mjvone15-Mar-05 10:09 
AnswerRe: How to send info out the lpt port????? Pin
Christian Graus15-Mar-05 10:47
protectorChristian Graus15-Mar-05 10:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.