Page 17 of 18

Posted: Wed Aug 27, 2008 10:08 pm
by SFSxOI
But in your vbs.pb example supplied with your lib:

Code: Select all

dhCallMethod(obj, "AddCode(%T)", @Script)
AddCode(%T) works fine here in Vista.

Posted: Wed Aug 27, 2008 10:12 pm
by ts-soft
I become a error on vista ultimate 64, don't know

Posted: Wed Aug 27, 2008 10:20 pm
by SFSxOI
I'm using Vista Ultimate 32 bit and AddCode(%T) works fine here.

OK got it working now - sort of, returns the Local Link IPv6 address with a single adapter installed but i don't know if it will return the info for multiple adapters. The return is supposed to return as an array. How do I get an array into the script?

Code: Select all

Procedure.s AdapterConfig() ; Returns AdapterConfig 

   Protected Script$ 
      
       Script$ = "Set objWMIService = GetObject(" + Chr(34) + "winmgmts:" + Chr(34) + " _" + #CRLF$ 
       Script$ + "    & " + Chr(34) + "{impersonationLevel=impersonate}!\\.\root\cimv2" + Chr(34) + ")" + #CRLF$ 
       Script$ + "Set IPConfigSet = objWMIService.ExecQuery _" + #CRLF$ 
       Script$ + "    (" + Chr(34) + "Select IPAddress from Win32_NetworkAdapterConfiguration" + Chr(34) + ")" + #CRLF$ 
       Script$ + "For Each IPConfig in IPConfigSet" + #CRLF$ 
       Script$ + "    If Not IsNull(IPConfig.IPAddress) Then " + #CRLF$ 
       Script$ + "        For i=LBound(IPConfig.IPAddress) to UBound(IPConfig.IPAddress)" + #CRLF$ 
       Script$ + "            name = IPConfig.IPAddress(i)" + #CRLF$ 
       Script$ + "        Next" + #CRLF$ 
       Script$ + "    End If" + #CRLF$ 
       Script$ + "Next" + #CRLF$ 
      
   ProcedureReturn Script$ 
EndProcedure


dhToggleExceptions(#True)

Define.l Result, obj = dhCreateObject("MSScriptControl.ScriptControl")
Define.s Script

If obj

  dhPutValue(obj, "Language = %T", @"VBScript")
  dhGetValue("%T", @Result, obj, "Language")

  If Result

    dhFreeString(Result) : Result = 0

  EndIf

  Script = AdapterConfig()
  dhCallMethod(obj, "AddCode(%T)", @Script)
  dhGetValue("%T", @Result, obj, "Eval(%T)", @"name")

  If Result

    Debug "Adapter:  " + PeekS(Result)
    dhFreeString(Result) : Result = 0

  EndIf

  dhReleaseObject(obj) : obj = 0

EndIf

Posted: Wed Aug 27, 2008 10:26 pm
by ts-soft
With the working code, no error on vista, so it's only a false error-report in
vista.

:wink:

Posted: Wed Aug 27, 2008 10:38 pm
by SFSxOI
The return is supposed to return as an array. How do I get an array into the darn thing now?

Posted: Wed Aug 27, 2008 10:50 pm
by ts-soft
In the examples folder, DispHelper_Include\VariantHelper_Include.pb should
help you. Some examples included

Posted: Wed Aug 27, 2008 10:57 pm
by SFSxOI
You mean for safe array? I looked at that, trying to get it shoe horned in. Seems like a lot of work for such a small script :) Is there a way to just include a .vbs and use the lib to run the script directly?

Posted: Wed Aug 27, 2008 11:07 pm
by ts-soft

Posted: Fri Aug 29, 2008 12:21 pm
by srod
For those having problems getting dhgetobject() to work when using ts-soft's 'DispHelper_Include.pb' file, it is because the DispHelper library expects the first parameter to equal zero in the case that a file path is not being supplied. As it is a non-zero pointer to a null string (bstr) is being passed which is fooling DispHelper into thinking a valid file has been passed. In these cases DispHelper defaults (if a progID is given) to creating a new instance of a pre-registered component.

Here is an adjusted version of the 'DispHelper_Include.pb' file which works around the problem : (tested with Excel and it works fine with existing instances of Excel etc.)

Code: Select all

REMOVED - see ts-soft's post below.

Posted: Fri Aug 29, 2008 2:37 pm
by ts-soft
thanks stephen :D

download on www.realsource.de updated

First try with active X needs Big help

Posted: Mon Feb 02, 2009 6:03 am
by John-G
Hello,

I did not know that we could do ActiveX. :? Here is my work

i downloaded TAPEx.com @ and here is want it shows That i need to add to get it working with out a lot of program time it I am a little lost ':shock:'
OnToneDetected
The OnToneDetected event will be fired when a tone detected.

Event OnToneDetected(
AppSpecific As Long,
Position As Long)
Parameters
AppSpecific
Used by the application for tagging the tone.
Position
the referenced position.

See Also
MonitorTones_Add

Code: Select all

;this is VB Code 
        ' Decode the '0'-'#'  DTMF keys
        .MonitorTones_Add 1, 80, 0, 697, 1209         ' "1"
        .MonitorTones_Add 2, 80, 0, 697, 1336         ' "2"
        .MonitorTones_Add 3, 80, 0, 697, 1477         ' "3"
        .MonitorTones_Add 4, 80, 0, 770, 1209         ' "4"
        .MonitorTones_Add 5, 80, 0, 770, 1336         ' "5"
        .MonitorTones_Add 6, 80, 0, 770, 1477         ' "6"
        .MonitorTones_Add 7, 80, 0, 852, 1209         ' "7"
        .MonitorTones_Add 8, 80, 0, 852, 1336         ' "8"
        .MonitorTones_Add 9, 80, 0, 852, 1477         ' "9"
        .MonitorTones_Add 10, 80, 0, 941, 1209        ' "*"
        .MonitorTones_Add 0,  80, 0, 941, 1336        ' "0"
        .MonitorTones_Add 12, 80, 0, 941, 1477        ' "#"



  .MonitorTones_Add  1, 500, 0, 480, 620, 0,  0,  0 , -20      '  Monitor the 480Hz, 620Hz dual tone and it amplitude must >-20dB
  .MonitorTones_Add  1, 500, 0, 350, 440, 0,  0, -12, -40      '  Monitor the 350Hz, 440Hz dual tone and it amplitude must  in range  -12dB to -40dB
  .MonitorTones_Add  1, 500, 0, 350, 440, 0,  0, -20, 0        '  Monitor the 350Hz, 440Hz dual tone and it amplitude must  < -20dB 
  
' use feature of negation gate : 
  .MonitorTones_Add  1, 50, 0, -450			      		' Monitor the non 450Hz signal (OnToneDetected will be fired if the signal neither in 450Hz nor silence for 50ms.)
  .MonitorTones_Add  1, 50, 0, 480, -620		            ' Monitor the 480Hz and non 620Hz signal 

;
;Here it says 
I am trying to use there FTT to read the Sound Card and am Lost of to where to go here is the DOC that comes withit

MonitorTones_Add
The MonitorTones_Add method enables the detection of inband tones. Each time a specified tone is detected, OnToneDetected will be fired.

Function MonitorTones_Add(
AppSpecific As Long,
MinPeriodOn As Long,
MinPeriodOff As Long,
[Frequency1 As Long],[Frequency2 As Long], [Frequency3 As Long], [Frequency4 As Long],
[MinAmpdB As Single],
[MaxAmpdB As Single]
) As Boolean
Parameters
AppSpecific
Used by the application for tagging the tone. When this tone is detected, Event OnToneDetected() fires with the value of the AppSpecific as parameter.
MinPeriodOn
The minimal duration of the period on in milliseconds, during which the tone should be present before a detection is made.
MinPeriodOff
The minimal duration of the period off in milliseconds, during which the tone should be present before a detection is made. Leave it zero to ignore this parameter.
Frequency1, Frequency2, Frequency3, Frequency4
The frequency, in hertz, of a component of the tone. If fewer than three frequencies are needed in the tone, a value of 0 should be used for the unused frequencies. A tone with all frequencies set to zero is interpreted as silence and can be used for silence detection. If FrequencyX is negative, it works as negation gate. For more info, read the example below.
MinAmpdB
The minimal amplitude in decibel of the those frequencies above. Range from -1dB to -60dB . if it is zero, MinAmpdB will be ignored. Otherwise the tones which amplitude of those frequencies smaller than the MinAmpdB will be filtered.
MaxAmpdB
The maximal amplitude in decibel of the those frequencies above. Range from -1dB to -60dB . if it is zero, MaxAmpdB will be ignored. Otherwise the tones which amplitude of those frequencies bigger than the MinAmpdB will be filtered.
Return Values
If the method succeeds, return TRUE. If the function fails, the return value is FALSE.
I dont know what i need to do to get this in my code I have the [/quote]
:?

Re: PureDispHelper UserLib - Update with Includefile for Uni

Posted: Sun Feb 22, 2009 12:52 pm
by PB
> PureDisphelper v.1.5

The link above needs English text. :(

Re: PureDispHelper UserLib - Update with Includefile for Uni

Posted: Sun Feb 22, 2009 7:31 pm
by ts-soft
PB wrote:> PureDisphelper v.1.5

The link above needs English text. :(
Sorry, is a german side
Image
greetings
Thomas

Re: PureDispHelper UserLib - Update with Includefile for Uni

Posted: Sun Oct 03, 2010 4:48 pm
by Alireza
Hello
is there a x64 (win7) + pb 4.51 version of PureDisphelper?

i get this msg:

Image

Re: PureDispHelper UserLib - Update with Includefile for Uni

Posted: Mon Oct 04, 2010 1:10 am
by netmaestro
iirc this comes with a .PBI include which can be used as an alternative to the compiled lib. If so, that should work without problems.