AVIRA AntiVirus barks only with Debugger enabledMarco2007 wrote:I bought the license for two years.

AVIRA AntiVirus barks only with Debugger enabledMarco2007 wrote:I bought the license for two years.


Code: Select all
strComputer = "."
Set objWMIService = GetObject( _ 
    "winmgmts:\\" & strComputer & "\root\cimv2")
Set IPConfigSet = objWMIService.ExecQuery _
    ("Select IPAddress from Win32_NetworkAdapterConfiguration ")
 
For Each IPConfig in IPConfigSet
    If Not IsNull(IPConfig.IPAddress) Then 
        For i=LBound(IPConfig.IPAddress) _
            To UBound(IPConfig.IPAddress)
                WScript.Echo IPConfig.IPAddress(i)
        Next
    End If
Next



Can you provide an example on how you called that VBS script? Did you (or have you?) found a way to call PB functions from VBS?SFSxOI wrote:srod,
Very Nice, its already helpful in a project i'm working on. Thank you very much.
Tried it out on some vbs i had laying around, doesn't work in this type of vbs code tho:
and the flash demo doesn't work here on Vista UltimateCode: Select all
strComputer = "." Set objWMIService = GetObject( _ "winmgmts:\" & strComputer & "\root\cimv2") Set IPConfigSet = objWMIService.ExecQuery _ ("Select IPAddress from Win32_NetworkAdapterConfiguration ") For Each IPConfig in IPConfigSet If Not IsNull(IPConfig.IPAddress) Then For i=LBound(IPConfig.IPAddress) _ To UBound(IPConfig.IPAddress) WScript.Echo IPConfig.IPAddress(i) Next End If Next
Code: Select all
XIncludeFile "COMate.pbi"
Define.COMateObject objWMIService, processorObject
collection.COMateEnumObject
strComputer.s = "."
objWMIService = COMate_GetObject("winmgmts:\\" + strComputer + "\root\cimv2", "")
If objWMIService
  collection = objWMIService\CreateEnumeration("ExecQuery('Select * from Win32_Processor')")
  If collection
    processorObject = collection\GetNextObject()
    While processorObject
      Debug processorObject\GetStringProperty("currentClockSpeed")
      processorObject\Release()
      processorObject = collection\GetNextObject()
    Wend
  EndIf  
EndIf 


Code: Select all
XIncludeFile "COMate.pbi"
Define.COMateObject objWMIService, IPConfig
IPConfigSet.COMateEnumObject
*var.VARIANT
strComputer.s = "."
objWMIService = COMate_GetObject("winmgmts:\\" + strComputer + "\root\cimv2", "")
If objWMIService
  IPConfigSet = objWMIService\CreateEnumeration("ExecQuery('Select IPAddress from Win32_NetworkAdapterConfiguration')")
  If IPConfigSet
    IPConfig = IPConfigSet\GetNextObject()
    While IPConfig
      If IPConfig
        *var = IPConfig\GetVariantProperty("IPAddress")
        Debug *var\vt
        
        VariantClear_(*var)
        IPConfig\Release()
      EndIf
      IPConfig = IPConfigSet\GetNextObject()
    Wend
  EndIf  
EndIf  I am guessing, but I don't think even DispHelper would work with this code of yours?
  I am guessing, but I don't think even DispHelper would work with this code of yours?Code: Select all
XIncludeFile "COMate.pbi"
object.COMateObject
a.l = 20
object = COMate_CreateObject("ActiveXTest.clsActiveXTest")
If object = 0
  COMate_RegisterActiveXServer("Projekt1.dll")
  object = COMate_CreateObject("ActiveXTest.clsActiveXTest")
EndIf
If object
  object = COMate_CreateObject("ActiveXTest.clsActiveXTest")
  If object
    object\Invoke("Test1(" + Str(@a) + " as long BYREF)")    
    object\Release()
  EndIf
  COMate_UnRegisterActiveXServer("Projekt1.dll", #False)
  Debug "New value of a is " + Str(a)
EndIf

This is what your above returns:srod wrote:SFSxOI : can you run the following to see what kind of variants are being returned? I need to know the value being debugged?
Code: Select all
XIncludeFile "COMate.pbi" Define.COMateObject objWMIService, IPConfig IPConfigSet.COMateEnumObject *var.VARIANT strComputer.s = "." objWMIService = COMate_GetObject("winmgmts:\" + strComputer + "\root\cimv2", "") If objWMIService IPConfigSet = objWMIService\CreateEnumeration("ExecQuery('Select IPAddress from Win32_NetworkAdapterConfiguration')") If IPConfigSet IPConfig = IPConfigSet\GetNextObject() While IPConfig If IPConfig *var = IPConfig\GetVariantProperty("IPAddress") Debug *var\vt VariantClear_(*var) IPConfig\Release() EndIf IPConfig = IPConfigSet\GetNextObject() Wend EndIf EndIf
Code: Select all
1
1
1
1
8204
1
1
1
1
1
1
Code: Select all
Define.COMateObject objWMIService, IPConfig
Define.s strComputer = "."
objWMIService = COMate_GetObject("winmgmts:\" + strComputer + "\root\cimv2", "") 
If objWMIService 
  IPConfig = objWMIService\ExecQuery("Select IPAddress from Win32_NetworkAdapterConfiguration") 
  If IPConfig 
    While IPConfig 
        Debug IPConfig\IPAddress 
      EndIf 
    Wend 
  EndIf  
EndIf
 You're attempting to execute COM methods on internal COMate objects! You have also not created an enumeration of IPAddress objects etc. Someone hasn't read the COMate manual!
 You're attempting to execute COM methods on internal COMate objects! You have also not created an enumeration of IPAddress objects etc. Someone hasn't read the COMate manual!   You need to look at the code of mine which you ran as a test, that is how we must proceed. What your test has confirmed is that we simply need to complete the code.
   You need to look at the code of mine which you ran as a test, that is how we must proceed. What your test has confirmed is that we simply need to complete the code. The 1's represent null returns, presumably from adapters with no ip address. You should modify the query to filter these values out. Should be easy enough.
  The 1's represent null returns, presumably from adapters with no ip address. You should modify the query to filter these values out. Should be easy enough. Difficult for me because I can't run the code in order to make tests as I proceed etc; I have no network adapters yielding any results and I do not have enough experience with SafeArrays to figure out the code whilst running blind!
 Difficult for me because I can't run the code in order to make tests as I proceed etc; I have no network adapters yielding any results and I do not have enough experience with SafeArrays to figure out the code whilst running blind!

