Microsoft
Software
Hardware
Network
Question : I have this function, but unable to put results on the form
I want to put the results on a form. Msgbox displays the informatio, but do not know how to transfer the information to my form.
What do I need to do to get the results in my form?
Below is the code:
Option Compare Database
Private Declare Function OpenProcess Lib "Kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function GetExitCodeProcess Lib "Kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long
Private Declare Sub Sleep Lib "Kernel32" (ByVal dwMilliseconds As Long)
Const STILL_ACTIVE = &H103
Const PROCESS_QUERY_INFORMATION = &H400
Private Sub Shell32Bit(ByVal JobToDo As String)
Dim hProcess As Long
Dim RetVal As Long
hProcess = OpenProcess(PROCESS_QUERY_
INFORMATIO
N, False, Shell(JobToDo, vbHide))
Do
GetExitCodeProcess hProcess, RetVal
DoEvents: Sleep 100
Loop While RetVal = STILL_ACTIVE
End Sub
Function findit()
Dim b As String
Dim C As String
Dim D As String
If Dir("C:\tmpp.txt") <> "" Then Kill ("C:\tmpp.txt")
Shell32Bit "command.com /c ipconfig /all > C:\tmpp.txt"
Open "C:\tmpp.txt" For Input As #1
Do Until D = "1"
Line Input #1, b
C = Trim(b)
If Mid(C, 1, 16) = "Physical Address" Then
Line Input #1, b
MsgBox Mid(C, 36, 18)
D = "1"
End If
Loop
Close #1
'If Dir("c:\tmpp") <> "" Then Kill "c:\tmpp"
End Function
Answer : I have this function, but unable to put results on the form
when (on what event) do you want to show the value returned by the function?
me.hold=findit()
Random Solutions
sharing open ports in c#
How to call more than one function in a procedure
Pass more then 1 value to ConverterParameter\Binding<wbr />Item
Use of Cards.dll in VB.NET
asp.net ..for loop - limit to reading first row of DataRow in dtVolumeOrder.Rows()
Datagrid columns are jumbled up when there are no rows (ASP.NET C#)
Learning Active Directory
SQL DBCC CHECKDB finds errors that it cannot fix
Hide background Image
Using Template Files and SendObject in a Macro